<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
   <html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <title>File Source for SwfCompiler.php</title>
  <link rel="stylesheet" href="../media/stylesheet.css" />
<!-- template designed by Julien Damon based on PHPEdit's generated templates, and tweaked by Greg Beaver -->
<body bgcolor="#ffffff" ><h1 align="center">Source for file SwfCompiler.php</h1>
<p>Documentation is available at <a href="../SWX/_SwfCompiler.php.html">SwfCompiler.php</a></p>
<div class="src-code">
<div class="src-code"><ol><li><div class="src-line"><a name="a1"></a><strong>&lt;?php</strong></div></li>
<li><div class="src-line"><a name="a2"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a3"></a><font color="#009999">/**</font></div></li>
<li><div class="src-line"><a name="a4"></a><font color="#009999">&nbsp;*&nbsp;SWF&nbsp;Compiler&nbsp;class&nbsp;for&nbsp;SWX.</font></div></li>
<li><div class="src-line"><a name="a5"></a><font color="#009999">&nbsp;*&nbsp;Collection&nbsp;of&nbsp;methods&nbsp;that&nbsp;compile&nbsp;a&nbsp;SWX&nbsp;SWF.</font></div></li>
<li><div class="src-line"><a name="a6"></a><font color="#009999">&nbsp;*&nbsp;Released&nbsp;under&nbsp;the&nbsp;GNU&nbsp;GPL&nbsp;license.</font></div></li>
<li><div class="src-line"><a name="a7"></a><font color="#009999">&nbsp;*&nbsp;</font></div></li>
<li><div class="src-line"><a name="a8"></a><font color="#009999">&nbsp;*&nbsp;Author:&nbsp;Aral&nbsp;Balkan</font></div></li>
<li><div class="src-line"><a name="a9"></a><font color="#009999">&nbsp;*&nbsp;Copyright&nbsp;(c)&nbsp;2007&nbsp;Aral&nbsp;Balkan.</font></div></li>
<li><div class="src-line"><a name="a10"></a><font color="#009999">&nbsp;*&nbsp;http://aralbalkan.com</font></div></li>
<li><div class="src-line"><a name="a11"></a><font color="#009999">&nbsp;*&nbsp;</font></div></li>
<li><div class="src-line"><a name="a12"></a><font color="#009999">&nbsp;*&nbsp;http://swxformat.org</font></div></li>
<li><div class="src-line"><a name="a13"></a><font color="#009999">&nbsp;*/</font></div></li>
<li><div class="src-line"><a name="a14"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a15"></a><font color="green">//&nbsp;PHP&nbsp;5&nbsp;compatibility&nbsp;layer&nbsp;for&nbsp;PHP&nbsp;4</font></div></li>
<li><div class="src-line"><a name="a16"></a><font color="blue">require_once</font><strong>(</strong><font color="#66cccc">'lib/str_split.php'</font><strong>)</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a17"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a18"></a><font color="green">//&nbsp;Constants</font></div></li>
<li><div class="src-line"><a name="a19"></a><a href="http://www.php.net/define">define</a>&nbsp;<strong>(</strong><font color="#66cccc">'LITTLE_ENDIAN'</font><strong>,&nbsp;</strong><font color="#66cccc">'little-endian'</font><strong>)</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a20"></a><a href="http://www.php.net/define">define</a>&nbsp;<strong>(</strong><font color="#66cccc">'BIG_ENDIAN'</font><strong>,&nbsp;</strong><font color="#66cccc">'big-endian'</font><strong>)</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a21"></a><a href="http://www.php.net/define">define</a>&nbsp;<strong>(</strong><font color="#66cccc">'BI_ENDIAN'</font><strong>,&nbsp;</strong><font color="#66cccc">'bi-endian'</font><strong>)</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a22"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a23"></a><font color="blue">class&nbsp;</font><a href="../SWX/SwfCompiler.html">SwfCompiler</a></div></li>
<li><div class="src-line"><a name="a24"></a><strong>{</strong></div></li>
<li><div class="src-line"><a name="a25"></a>&nbsp;&nbsp;&nbsp;&nbsp;<font color="blue">var&nbsp;</font><a href="../SWX/SwfCompiler.html#var$stack">$stack</a>&nbsp;=&nbsp;<font color="#66cccc">''</font><strong>;</strong></div></li>
<li><div class="src-line"><a name="a26"></a>&nbsp;&nbsp;&nbsp;&nbsp;<font color="blue">var&nbsp;</font><a href="../SWX/SwfCompiler.html#var$endian">$endian</a>&nbsp;=&nbsp;NULL<strong>;</strong></div></li>
<li><div class="src-line"><a name="a27"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a28"></a>&nbsp;&nbsp;&nbsp;&nbsp;<font color="blue">function&nbsp;</font><a href="../SWX/SwfCompiler.html#methodSwfCompiler">SwfCompiler</a><strong>(</strong><strong>)</strong></div></li>
<li><div class="src-line"><a name="a29"></a>&nbsp;&nbsp;&nbsp;&nbsp;<strong>{</strong></div></li>
<li><div class="src-line"><a name="a30"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="blue">global&nbsp;</font><strong>$endian</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a31"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a32"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;Determine&nbsp;endianness&nbsp;of&nbsp;the&nbsp;system&nbsp;that&nbsp;this&nbsp;is&nbsp;running&nbsp;under</font></div></li>
<li><div class="src-line"><a name="a33"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;Adapted&nbsp;from:&nbsp;http://phpfer.com/rn45re877.html</font></div></li>
<li><div class="src-line"><a name="a34"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>$ab&nbsp;</strong>=&nbsp;0x6162<strong>;</strong></div></li>
<li><div class="src-line"><a name="a35"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a36"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;Convert&nbsp;$ab&nbsp;to&nbsp;a&nbsp;binary&nbsp;string&nbsp;containing&nbsp;32&nbsp;bits</font></div></li>
<li><div class="src-line"><a name="a37"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;Do&nbsp;the&nbsp;conversion&nbsp;the&nbsp;way&nbsp;that&nbsp;the&nbsp;system&nbsp;architecture&nbsp;wants&nbsp;to</font></div></li>
<li><div class="src-line"><a name="a38"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="blue">switch&nbsp;</font><strong>(</strong><a href="http://www.php.net/pack">pack</a>&nbsp;<strong>(</strong><font color="#66cccc">'L'</font><strong>,&nbsp;</strong><strong>$ab</strong><strong>))</strong></div></li>
<li><div class="src-line"><a name="a39"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>{</strong></div></li>
<li><div class="src-line"><a name="a40"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;Compare&nbsp;the&nbsp;value&nbsp;to&nbsp;the&nbsp;same&nbsp;value&nbsp;converted&nbsp;in&nbsp;a&nbsp;Little-Endian&nbsp;fashion</font></div></li>
<li><div class="src-line"><a name="a41"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;case&nbsp;<a href="http://www.php.net/pack">pack</a>&nbsp;<strong>(</strong><font color="#66cccc">'V'</font><strong>,&nbsp;</strong><strong>$ab</strong><strong>)</strong>:</div></li>
<li><div class="src-line"><a name="a42"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>$endian&nbsp;</strong>=&nbsp;<a href="../SWX/_SwfCompiler.php.html#defineLITTLE_ENDIAN">LITTLE_ENDIAN</a><strong>;</strong></div></li>
<li><div class="src-line"><a name="a43"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;break<strong>;</strong></div></li>
<li><div class="src-line"><a name="a44"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a45"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;Compare&nbsp;the&nbsp;value&nbsp;to&nbsp;the&nbsp;same&nbsp;value&nbsp;converted&nbsp;in&nbsp;a&nbsp;Big-Endian&nbsp;fashion</font></div></li>
<li><div class="src-line"><a name="a46"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;TODO:&nbsp;Test&nbsp;on&nbsp;a&nbsp;big-endian&nbsp;machine.&nbsp;Currently&nbsp;SWX&nbsp;is&nbsp;not&nbsp;supported&nbsp;on&nbsp;</font></div></li>
<li><div class="src-line"><a name="a47"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;big&nbsp;endian&nbsp;machines.</font></div></li>
<li><div class="src-line"><a name="a48"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;case&nbsp;<a href="http://www.php.net/pack">pack</a>&nbsp;<strong>(</strong><font color="#66cccc">'V'</font><strong>,&nbsp;</strong><strong>$ab</strong><strong>)</strong>:</div></li>
<li><div class="src-line"><a name="a49"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>$endian&nbsp;</strong>=&nbsp;<a href="../SWX/_SwfCompiler.php.html#defineBIG_ENDIAN">BIG_ENDIAN</a><strong>;</strong></div></li>
<li><div class="src-line"><a name="a50"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;break<strong>;</strong></div></li>
<li><div class="src-line"><a name="a51"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a52"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;Bi-endian&nbsp;or&nbsp;middle&nbsp;endian.&nbsp;The&nbsp;biggest&nbsp;use&nbsp;case&nbsp;for&nbsp;this&nbsp;is&nbsp;</font></div></li>
<li><div class="src-line"><a name="a53"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;PowerPC&nbsp;architectures.&nbsp;In&nbsp;fact,&nbsp;take&nbsp;this&nbsp;to&nbsp;mean&nbsp;PowerPC&nbsp;support.</font></div></li>
<li><div class="src-line"><a name="a54"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;default:</div></li>
<li><div class="src-line"><a name="a55"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>$endian&nbsp;</strong>=&nbsp;<a href="../SWX/_SwfCompiler.php.html#defineBI_ENDIAN">BI_ENDIAN</a><strong>;</strong></div></li>
<li><div class="src-line"><a name="a56"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>}</strong></div></li>
<li><div class="src-line"><a name="a57"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a58"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.php.net/error_log">error_log</a>&nbsp;<strong>(</strong><font color="#66cccc">'[SWX]&nbsp;INFO&nbsp;Running&nbsp;on&nbsp;a&nbsp;'</font>.<strong>$endian</strong>.<font color="#66cccc">'&nbsp;system.'</font><strong>)</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a59"></a>&nbsp;&nbsp;&nbsp;&nbsp;<strong>}</strong></div></li>
<li><div class="src-line"><a name="a60"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a61"></a>&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;From&nbsp;http://de.php.net/var_dump</font></div></li>
<li><div class="src-line"><a name="a62"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="blue">function&nbsp;</font><a href="../SWX/SwfCompiler.html#methodgetVarDump">getVarDump</a><strong>(</strong><strong>$mixed&nbsp;</strong>=&nbsp;null<strong>)&nbsp;</strong></div></li>
<li><div class="src-line"><a name="a63"></a>&nbsp;&nbsp;&nbsp;&nbsp;<strong>{</strong></div></li>
<li><div class="src-line"><a name="a64"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.php.net/ob_start">ob_start</a><strong>(</strong><strong>)</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a65"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.php.net/var_dump">var_dump</a><strong>(</strong><strong>$mixed</strong><strong>)</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a66"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>$content&nbsp;</strong>=&nbsp;<a href="http://www.php.net/ob_get_contents">ob_get_contents</a><strong>(</strong><strong>)</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a67"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.php.net/ob_end_clean">ob_end_clean</a><strong>(</strong><strong>)</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a68"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="blue">return&nbsp;</font><strong>$content</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a69"></a>&nbsp;&nbsp;&nbsp;&nbsp;<strong>}</strong></div></li>
<li><div class="src-line"><a name="a70"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a71"></a>&nbsp;&nbsp;&nbsp;&nbsp;<font color="#009999">/**</font></div></li>
<li><div class="src-line"><a name="a72"></a><font color="#009999">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Converts&nbsp;the&nbsp;passed&nbsp;object&nbsp;to&nbsp;arrays.</font></div></li>
<li><div class="src-line"><a name="a73"></a><font color="#009999">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</font></div></li>
<li><div class="src-line"><a name="a74"></a><font color="#009999">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</font><strong><font color = "#0099FF">@return&nbsp;</font></strong><em>void&nbsp;</em></div></li>
<li><div class="src-line"><a name="a75"></a><font color="#009999">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</font><strong><font color = "#0099FF">@author</font></strong><font color="#009999">&nbsp;Aral&nbsp;Balkan</font></div></li>
<li><div class="src-line"><a name="a76"></a><font color="#009999">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;***/</font></div></li>
<li><div class="src-line"><a name="a77"></a>&nbsp;&nbsp;&nbsp;&nbsp;<font color="blue">function&nbsp;</font><a href="../SWX/SwfCompiler.html#methodobjectToArray">objectToArray</a><strong>(</strong><strong>$data</strong>=<font color="#66cccc">''</font><strong>)&nbsp;</strong></div></li>
<li><div class="src-line"><a name="a78"></a>&nbsp;&nbsp;&nbsp;&nbsp;<strong>{</strong></div></li>
<li><div class="src-line"><a name="a79"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>$arr&nbsp;</strong>=&nbsp;array<strong>(</strong><strong>)</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a80"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="blue">foreach&nbsp;</font><strong>(</strong><strong>$data&nbsp;</strong>as&nbsp;<strong>$key&nbsp;</strong>=&gt;&nbsp;<strong>$value&nbsp;</strong><strong>)</strong></div></li>
<li><div class="src-line"><a name="a81"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>{</strong></div></li>
<li><div class="src-line"><a name="a82"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="blue">if&nbsp;</font><strong>(</strong><a href="http://www.php.net/gettype">gettype</a><strong>(</strong><strong>$value</strong><strong>)&nbsp;</strong>==&nbsp;<font color="#66cccc">'object'</font><strong>)</strong></div></li>
<li><div class="src-line"><a name="a83"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>{</strong></div></li>
<li><div class="src-line"><a name="a84"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>$arr</strong><strong>[</strong><strong>$key</strong><strong>]&nbsp;</strong>=&nbsp;<strong>$this</strong><strong>-&gt;</strong><a href="../SWX/SwfCompiler.html#methodobjectToArray">objectToArray</a><strong>(</strong><strong>$value</strong><strong>)</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a85"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>}</strong></div></li>
<li><div class="src-line"><a name="a86"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else</div></li>
<li><div class="src-line"><a name="a87"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>{</strong></div></li>
<li><div class="src-line"><a name="a88"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>$arr</strong><strong>[</strong><strong>$key</strong><strong>]&nbsp;</strong>=&nbsp;<strong>$value</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a89"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>}</strong></div></li>
<li><div class="src-line"><a name="a90"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>}</strong></div></li>
<li><div class="src-line"><a name="a91"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="blue">return&nbsp;</font><strong>$arr</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a92"></a>&nbsp;&nbsp;&nbsp;&nbsp;<strong>}</strong></div></li>
<li><div class="src-line"><a name="a93"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a94"></a>&nbsp;&nbsp;&nbsp;&nbsp;<font color="#009999">/**</font></div></li>
<li><div class="src-line"><a name="a95"></a><font color="#009999">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Parses&nbsp;the&nbsp;given&nbsp;data&nbsp;structure&nbsp;(any&nbsp;type)&nbsp;and</font></div></li>
<li><div class="src-line"><a name="a96"></a><font color="#009999">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;returns&nbsp;SWF&nbsp;bytecode.</font></div></li>
<li><div class="src-line"><a name="a97"></a><font color="#009999">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</font></div></li>
<li><div class="src-line"><a name="a98"></a><font color="#009999">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</font><strong><font color = "#0099FF">@param&nbsp;</font></strong><font color="#009999">&nbsp;&nbsp;&nbsp;</font><em>any&nbsp;</em><font color="#009999">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;A&nbsp;PHP&nbsp;data&nbsp;structure</font></div></li>
<li><div class="src-line"><a name="a99"></a><font color="#009999">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</font><strong><font color = "#0099FF">@return&nbsp;</font></strong><font color="#009999">&nbsp;&nbsp;&nbsp;&nbsp;</font><em>string&nbsp;</em><font color="#009999">&nbsp;&nbsp;&nbsp;Swf&nbsp;bytecode&nbsp;representation&nbsp;of&nbsp;the&nbsp;data&nbsp;structure.</font></div></li>
<li><div class="src-line"><a name="a100"></a><font color="#009999">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</font><strong><font color = "#0099FF">@author</font></strong><font color="#009999">&nbsp;Aral&nbsp;Balkan</font></div></li>
<li><div class="src-line"><a name="a101"></a><font color="#009999">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;***/</font></div></li>
<li><div class="src-line"><a name="a102"></a>&nbsp;&nbsp;&nbsp;&nbsp;<font color="blue">function&nbsp;</font><a href="../SWX/SwfCompiler.html#methoddataToBytecode">dataToBytecode</a>&nbsp;<strong>(</strong><strong>$data</strong><strong>)</strong></div></li>
<li><div class="src-line"><a name="a103"></a>&nbsp;&nbsp;&nbsp;&nbsp;<strong>{</strong></div></li>
<li><div class="src-line"><a name="a104"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>$type&nbsp;</strong>=&nbsp;<a href="http://www.php.net/gettype">gettype</a><strong>(</strong><strong>$data</strong><strong>)</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a105"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a106"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="blue">switch</font><strong>(</strong><strong>$type</strong><strong>)</strong></div></li>
<li><div class="src-line"><a name="a107"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>{</strong></div></li>
<li><div class="src-line"><a name="a108"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;case&nbsp;<font color="#66cccc">'array'</font>:</div></li>
<li><div class="src-line"><a name="a109"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>$bytecode&nbsp;</strong>=&nbsp;<strong>$this</strong><strong>-&gt;</strong><a href="../SWX/SwfCompiler.html#methodarrayToBytecode">arrayToBytecode</a><strong>(</strong><strong>$data</strong><strong>)</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a110"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;break<strong>;</strong></div></li>
<li><div class="src-line"><a name="a111"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a112"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;case&nbsp;<font color="#66cccc">'object'</font>:</div></li>
<li><div class="src-line"><a name="a113"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;TODO:&nbsp;Handle&nbsp;objects&nbsp;natively&nbsp;without</font></div></li>
<li><div class="src-line"><a name="a114"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;converting&nbsp;to&nbsp;an&nbsp;associative&nbsp;array.</font></div></li>
<li><div class="src-line"><a name="a115"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a116"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;Convert&nbsp;object&nbsp;to&nbsp;array</font></div></li>
<li><div class="src-line"><a name="a117"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>$data&nbsp;</strong>=&nbsp;<strong>$this</strong><strong>-&gt;</strong><a href="../SWX/SwfCompiler.html#methodobjectToArray">objectToArray</a><strong>(</strong><strong>$data</strong><strong>)</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a118"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a119"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;And&nbsp;then&nbsp;use&nbsp;the&nbsp;array&nbsp;encoder</font></div></li>
<li><div class="src-line"><a name="a120"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>$bytecode&nbsp;</strong>=&nbsp;<strong>$this</strong><strong>-&gt;</strong><a href="../SWX/SwfCompiler.html#methodarrayToBytecode">arrayToBytecode</a><strong>(</strong><strong>$data</strong><strong>)</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a121"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;break<strong>;</strong></div></li>
<li><div class="src-line"><a name="a122"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a123"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;case&nbsp;<font color="#66cccc">'string'</font>:</div></li>
<li><div class="src-line"><a name="a124"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>$bytecode&nbsp;</strong>=&nbsp;<strong>$this</strong><strong>-&gt;</strong><a href="../SWX/SwfCompiler.html#methodstringToBytecode">stringToBytecode</a><strong>(</strong><strong>$data</strong><strong>)</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a125"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;break<strong>;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</strong></div></li>
<li><div class="src-line"><a name="a126"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a127"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;case&nbsp;<font color="#66cccc">'integer'</font>:</div></li>
<li><div class="src-line"><a name="a128"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>$bytecode&nbsp;</strong>=&nbsp;<strong>$this</strong><strong>-&gt;</strong><a href="../SWX/SwfCompiler.html#methodintegerToBytecode">integerToBytecode</a><strong>(</strong><strong>$data</strong><strong>)</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a129"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;break<strong>;</strong></div></li>
<li><div class="src-line"><a name="a130"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a131"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;case&nbsp;<font color="#66cccc">'double'</font>:</div></li>
<li><div class="src-line"><a name="a132"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>$bytecode&nbsp;</strong>=&nbsp;<strong>$this</strong><strong>-&gt;</strong><a href="../SWX/SwfCompiler.html#methoddoubleToBytecode">doubleToBytecode</a><strong>(</strong><strong>$data</strong><strong>)</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a133"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;break<strong>;</strong></div></li>
<li><div class="src-line"><a name="a134"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a135"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;case&nbsp;<font color="#66cccc">'boolean'</font>:</div></li>
<li><div class="src-line"><a name="a136"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>$bytecode&nbsp;</strong>=&nbsp;<strong>$this</strong><strong>-&gt;</strong><a href="../SWX/SwfCompiler.html#methodbooleanToBytecode">booleanToBytecode</a><strong>(</strong><strong>$data</strong><strong>)</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a137"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;break<strong>;</strong></div></li>
<li><div class="src-line"><a name="a138"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a139"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;case&nbsp;<font color="#66cccc">'NULL'</font>:</div></li>
<li><div class="src-line"><a name="a140"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>$bytecode&nbsp;</strong>=&nbsp;<a href="../SWX/_SwfCompiler.php.html#defineDATA_TYPE_NULL">DATA_TYPE_NULL</a><strong>;</strong></div></li>
<li><div class="src-line"><a name="a141"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;break<strong>;</strong></div></li>
<li><div class="src-line"><a name="a142"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a143"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;default:</div></li>
<li><div class="src-line"><a name="a144"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.php.net/trigger_error">trigger_error</a><strong>(</strong><font color="#66cccc">'Unhandled&nbsp;data&nbsp;type&nbsp;('</font>.<strong>$type</strong>.<font color="#66cccc">')'</font><strong>,&nbsp;</strong>E_USER_ERROR<strong>)</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a145"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//error_log('[SWX]&nbsp;ERROR&nbsp;dataToBytecode()&nbsp;Unhandled&nbsp;data&nbsp;type:&nbsp;'&nbsp;.&nbsp;$type);</font></div></li>
<li><div class="src-line"><a name="a146"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//$bytecode&nbsp;=&nbsp;&quot;ERROR&quot;;</font></div></li>
<li><div class="src-line"><a name="a147"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>}</strong></div></li>
<li><div class="src-line"><a name="a148"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a149"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="blue">return&nbsp;</font><strong>$bytecode</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a150"></a>&nbsp;&nbsp;&nbsp;&nbsp;<strong>}</strong></div></li>
<li><div class="src-line"><a name="a151"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a152"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a153"></a>&nbsp;&nbsp;&nbsp;&nbsp;<font color="#009999">/**</font></div></li>
<li><div class="src-line"><a name="a154"></a><font color="#009999">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Converts&nbsp;the&nbsp;passed&nbsp;array&nbsp;to&nbsp;SWF&nbsp;bytecode.</font></div></li>
<li><div class="src-line"><a name="a155"></a><font color="#009999">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</font></div></li>
<li><div class="src-line"><a name="a156"></a><font color="#009999">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</font><strong><font color = "#0099FF">@return&nbsp;</font></strong><em>string&nbsp;</em><font color="#009999">SWF&nbsp;bytecode.</font></div></li>
<li><div class="src-line"><a name="a157"></a><font color="#009999">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</font><strong><font color = "#0099FF">@author</font></strong><font color="#009999">&nbsp;Aral&nbsp;Balkan</font></div></li>
<li><div class="src-line"><a name="a158"></a><font color="#009999">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;***/</font></div></li>
<li><div class="src-line"><a name="a159"></a>&nbsp;&nbsp;&nbsp;&nbsp;<font color="blue">function&nbsp;</font><a href="../SWX/SwfCompiler.html#methodarrayToBytecode">arrayToBytecode</a><strong>(</strong><strong>$arr</strong><strong>)</strong></div></li>
<li><div class="src-line"><a name="a160"></a>&nbsp;&nbsp;&nbsp;&nbsp;<strong>{</strong></div></li>
<li><div class="src-line"><a name="a161"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;Note:&nbsp;We&nbsp;are&nbsp;going&nbsp;to&nbsp;write&nbsp;the&nbsp;bytecode&nbsp;backwards,</font></div></li>
<li><div class="src-line"><a name="a162"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;starting&nbsp;from&nbsp;the&nbsp;end&nbsp;as&nbsp;it's&nbsp;easier&nbsp;that&nbsp;way.&nbsp;</font></div></li>
<li><div class="src-line"><a name="a163"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a164"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>$bytecode&nbsp;</strong>=&nbsp;<font color="#66cccc">''</font><strong>;</strong></div></li>
<li><div class="src-line"><a name="a165"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a166"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;To&nbsp;count&nbsp;number&nbsp;of&nbsp;elements&nbsp;in&nbsp;the&nbsp;array</font></div></li>
<li><div class="src-line"><a name="a167"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>$arrCount&nbsp;</strong>=&nbsp;<a href="http://www.php.net/count">count</a><strong>(</strong><strong>$arr</strong><strong>)</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a168"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a169"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;Determine&nbsp;array&nbsp;type</font></div></li>
<li><div class="src-line"><a name="a170"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>$keys&nbsp;</strong>=&nbsp;<a href="http://www.php.net/array_keys">array_keys</a><strong>(</strong><strong>$arr</strong><strong>)</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a171"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a172"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="blue">if&nbsp;</font><strong>(</strong><strong>$arrCount&nbsp;</strong>==&nbsp;0&nbsp;||&nbsp;<a href="http://www.php.net/gettype">gettype</a><strong>(</strong><strong>$keys</strong><strong>[</strong>0<strong>]</strong><strong>)&nbsp;</strong>==&nbsp;<font color="#66cccc">'integer'</font><strong>)</strong></div></li>
<li><div class="src-line"><a name="a173"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>{</strong></div></li>
<li><div class="src-line"><a name="a174"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;Reverse&nbsp;the&nbsp;array&nbsp;to&nbsp;mirror&nbsp;how&nbsp;they're&nbsp;stored&nbsp;in&nbsp;a&nbsp;SWF&nbsp;(this</font></div></li>
<li><div class="src-line"><a name="a175"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;won't&nbsp;affect&nbsp;associative&nbsp;arrays&nbsp;(objects&nbsp;in&nbsp;Flash)&nbsp;but&nbsp;it&nbsp;will</font></div></li>
<li><div class="src-line"><a name="a176"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;make&nbsp;regular&nbsp;arrays&nbsp;appear&nbsp;in&nbsp;the&nbsp;right&nbsp;order.</font></div></li>
<li><div class="src-line"><a name="a177"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;$arr&nbsp;=&nbsp;array_reverse($arr);</font></div></li>
<li><div class="src-line"><a name="a178"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>$arrayType&nbsp;</strong>=&nbsp;<a href="../SWX/_SwfCompiler.php.html#defineARRAY_TYPE_REGULAR">ARRAY_TYPE_REGULAR</a><strong>;</strong></div></li>
<li><div class="src-line"><a name="a179"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>$bytecode&nbsp;</strong>=&nbsp;<a href="../SWX/_SwfCompiler.php.html#defineACTION_INIT_ARRAY">ACTION_INIT_ARRAY</a>&nbsp;.&nbsp;<strong>$bytecode</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a180"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>}</strong></div></li>
<li><div class="src-line"><a name="a181"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else</div></li>
<li><div class="src-line"><a name="a182"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>{</strong></div></li>
<li><div class="src-line"><a name="a183"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>$arrayType&nbsp;</strong>=&nbsp;<a href="../SWX/_SwfCompiler.php.html#defineARRAY_TYPE_ASSOCIATIVE">ARRAY_TYPE_ASSOCIATIVE</a><strong>;</strong></div></li>
<li><div class="src-line"><a name="a184"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>$bytecode&nbsp;</strong>=&nbsp;<a href="../SWX/_SwfCompiler.php.html#defineACTION_INIT_OBJECT">ACTION_INIT_OBJECT</a>&nbsp;.&nbsp;<strong>$bytecode</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a185"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>}</strong></div></li>
<li><div class="src-line"><a name="a186"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a187"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;Add&nbsp;the&nbsp;number&nbsp;of&nbsp;elements</font></div></li>
<li><div class="src-line"><a name="a188"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//</font></div></li>
<li><div class="src-line"><a name="a189"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;Optimized:&nbsp;</font></div></li>
<li><div class="src-line"><a name="a190"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;DATA_TYPE_INTEGER&nbsp;.&nbsp;strtoupper(str_pad($this-&gt;makeLittleEndian(dechex($arrCount)),&nbsp;8,&nbsp;'0'))&nbsp;.&nbsp;$bytecode;</font></div></li>
<li><div class="src-line"><a name="a191"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//</font></div></li>
<li><div class="src-line"><a name="a192"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;Clear:&nbsp;</font></div></li>
<li><div class="src-line"><a name="a193"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;$this-&gt;integerToBytecode($arrCount)&nbsp;.&nbsp;$bytecode;</font></div></li>
<li><div class="src-line"><a name="a194"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//</font></div></li>
<li><div class="src-line"><a name="a195"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>$bytecode&nbsp;</strong>=&nbsp;<strong>$this</strong><strong>-&gt;</strong><a href="../SWX/SwfCompiler.html#methodintegerToBytecode">integerToBytecode</a><strong>(</strong><strong>$arrCount</strong><strong>)&nbsp;</strong>.&nbsp;<strong>$bytecode</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a196"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a197"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;Profiling:&nbsp;</font></div></li>
<li><div class="src-line"><a name="a198"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//$forLoopStartTime&nbsp;=&nbsp;$this-&gt;microtime_float();</font></div></li>
<li><div class="src-line"><a name="a199"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a200"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="blue">foreach&nbsp;</font><strong>(</strong><strong>$arr&nbsp;</strong>as&nbsp;<strong>$key&nbsp;</strong>=&gt;&nbsp;<strong>$value</strong><strong>)</strong></div></li>
<li><div class="src-line"><a name="a201"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>{</strong></div></li>
<li><div class="src-line"><a name="a202"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;Check&nbsp;if&nbsp;the&nbsp;current&nbsp;bytecode&nbsp;length&nbsp;is&nbsp;approaching</font></div></li>
<li><div class="src-line"><a name="a203"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;the&nbsp;64K&nbsp;(65535&nbsp;byte)&nbsp;limit&nbsp;that&nbsp;we&nbsp;can&nbsp;store&nbsp;in&nbsp;a&nbsp;single&nbsp;push</font></div></li>
<li><div class="src-line"><a name="a204"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;and,&nbsp;if&nbsp;so,&nbsp;create&nbsp;a&nbsp;new&nbsp;push.</font></div></li>
<li><div class="src-line"><a name="a205"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a206"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;TODO:&nbsp;Refactor&nbsp;-&nbsp;pull&nbsp;out</font></div></li>
<li><div class="src-line"><a name="a207"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>$bytecodeLenInDec&nbsp;</strong>=&nbsp;<a href="http://www.php.net/strlen">strlen</a><strong>(</strong><strong>$bytecode</strong><strong>)</strong>/2<strong>;</strong></div></li>
<li><div class="src-line"><a name="a208"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="blue">if&nbsp;</font><strong>(</strong><strong>$bytecodeLenInDec&nbsp;</strong>&gt;=&nbsp;65520<strong>)&nbsp;</strong><font color="green">//&nbsp;For&nbsp;testing&nbsp;use&nbsp;&gt;=&nbsp;2)</font></div></li>
<li><div class="src-line"><a name="a209"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>{</strong></div></li>
<li><div class="src-line"><a name="a210"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;Calculate&nbsp;bytecode&nbsp;length&nbsp;*without*&nbsp;counting&nbsp;the&nbsp;</font></div></li>
<li><div class="src-line"><a name="a211"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;init&nbsp;object&nbsp;or&nbsp;init&nbsp;array&nbsp;action</font></div></li>
<li><div class="src-line"><a name="a212"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>$lastInstruction&nbsp;</strong>=&nbsp;<a href="http://www.php.net/substr">substr</a><strong>(</strong><strong>$bytecode</strong><strong>,&nbsp;</strong>-2<strong>)</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a213"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="blue">if&nbsp;</font><strong>(&nbsp;</strong><strong>$lastInstruction&nbsp;</strong>==&nbsp;<a href="../SWX/_SwfCompiler.php.html#defineACTION_INIT_OBJECT">ACTION_INIT_OBJECT</a>&nbsp;||&nbsp;<strong>$lastInstruction&nbsp;</strong>==&nbsp;<a href="../SWX/_SwfCompiler.php.html#defineACTION_INIT_ARRAY">ACTION_INIT_ARRAY</a><strong>)</strong></div></li>
<li><div class="src-line"><a name="a214"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>{</strong></div></li>
<li><div class="src-line"><a name="a215"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//error_log('(at&nbsp;end)&nbsp;IS&nbsp;COMPLEX&nbsp;-&nbsp;'.$lastInstruction);</font></div></li>
<li><div class="src-line"><a name="a216"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>$bytecodeLenInDec&nbsp;</strong>-=&nbsp;1<strong>;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</strong></div></li>
<li><div class="src-line"><a name="a217"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</strong></div></li>
<li><div class="src-line"><a name="a218"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a219"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;TODO:&nbsp;Refactor&nbsp;-&nbsp;pull&nbsp;out</font></div></li>
<li><div class="src-line"><a name="a220"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>$bytecodeLenInHex&nbsp;</strong>=&nbsp;<strong>$this</strong><strong>-&gt;</strong><a href="../SWX/SwfCompiler.html#methodgetIntAsHex">getIntAsHex</a><strong>(</strong><strong>$bytecodeLenInDec</strong><strong>,&nbsp;</strong>2<strong>)</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a221"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a222"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>$bytecode&nbsp;</strong>=&nbsp;<strong>$bytecodeLenInHex&nbsp;</strong>.&nbsp;<strong>$bytecode</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a223"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>$bytecode&nbsp;</strong>=&nbsp;<font color="#66cccc">'96'&nbsp;</font>.&nbsp;<strong>$bytecode</strong><strong>;&nbsp;&nbsp;&nbsp;&nbsp;</strong><font color="green">//&nbsp;Push.&nbsp;TODO:&nbsp;Replace&nbsp;w.&nbsp;constant</font></div></li>
<li><div class="src-line"><a name="a224"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a225"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;Store&nbsp;current&nbsp;instruction&nbsp;on&nbsp;the&nbsp;stack</font></div></li>
<li><div class="src-line"><a name="a226"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>$this</strong><strong>-&gt;</strong><a href="../SWX/SwfCompiler.html#var$stack">stack</a>&nbsp;=&nbsp;<strong>$bytecode&nbsp;</strong>.&nbsp;<strong>$this</strong><strong>-&gt;</strong><a href="../SWX/SwfCompiler.html#var$stack">stack</a><strong>;</strong></div></li>
<li><div class="src-line"><a name="a227"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a228"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;Reset&nbsp;the&nbsp;bytecode</font></div></li>
<li><div class="src-line"><a name="a229"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>$bytecode&nbsp;</strong>=&nbsp;<font color="#66cccc">''</font><strong>;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</strong></div></li>
<li><div class="src-line"><a name="a230"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>}</strong></div></li>
<li><div class="src-line"><a name="a231"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a232"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;Convert&nbsp;objects&nbsp;to&nbsp;arrays.</font></div></li>
<li><div class="src-line"><a name="a233"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;TODO:&nbsp;Handle&nbsp;objects&nbsp;natively.</font></div></li>
<li><div class="src-line"><a name="a234"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="blue">if&nbsp;</font><strong>(</strong><a href="http://www.php.net/gettype">gettype</a><strong>(</strong><strong>$value</strong><strong>)&nbsp;</strong>==&nbsp;<font color="#66cccc">'object'</font><strong>)</strong></div></li>
<li><div class="src-line"><a name="a235"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>{</strong></div></li>
<li><div class="src-line"><a name="a236"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>$value&nbsp;</strong>=&nbsp;<strong>$this</strong><strong>-&gt;</strong><a href="../SWX/SwfCompiler.html#methodobjectToArray">objectToArray</a><strong>(</strong><strong>$value</strong><strong>)</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a237"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>}</strong></div></li>
<li><div class="src-line"><a name="a238"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a239"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;Is&nbsp;this&nbsp;a&nbsp;simple&nbsp;data&nbsp;type&nbsp;or&nbsp;an&nbsp;array?</font></div></li>
<li><div class="src-line"><a name="a240"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="blue">if&nbsp;</font><strong>(</strong><a href="http://www.php.net/gettype">gettype</a><strong>(</strong><strong>$value</strong><strong>)&nbsp;</strong>==&nbsp;<font color="#66cccc">'array'</font><strong>)</strong></div></li>
<li><div class="src-line"><a name="a241"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>{</strong></div></li>
<li><div class="src-line"><a name="a242"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;Element&nbsp;is&nbsp;an&nbsp;array,&nbsp;we&nbsp;need&nbsp;to&nbsp;*push*&nbsp;it&nbsp;on&nbsp;to</font></div></li>
<li><div class="src-line"><a name="a243"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;the&nbsp;stack&nbsp;separately.&nbsp;End&nbsp;the&nbsp;current&nbsp;push.</font></div></li>
<li><div class="src-line"><a name="a244"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;(Note:&nbsp;this&nbsp;produces&nbsp;bytecode&nbsp;that&nbsp;differs&nbsp;from</font></div></li>
<li><div class="src-line"><a name="a245"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;what&nbsp;the&nbsp;Adobe&nbsp;compiler&nbsp;in&nbsp;Flash&nbsp;produces&nbsp;but</font></div></li>
<li><div class="src-line"><a name="a246"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;it's&nbsp;easier.)</font></div></li>
<li><div class="src-line"><a name="a247"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a248"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>$bytecodeLenInDec&nbsp;</strong>=&nbsp;<a href="http://www.php.net/strlen">strlen</a><strong>(</strong><strong>$bytecode</strong><strong>)</strong>/2<strong>;</strong></div></li>
<li><div class="src-line"><a name="a249"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a250"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;Calculate&nbsp;bytecode&nbsp;length&nbsp;*without*&nbsp;counting&nbsp;the&nbsp;</font></div></li>
<li><div class="src-line"><a name="a251"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;init&nbsp;object&nbsp;or&nbsp;init&nbsp;array&nbsp;action</font></div></li>
<li><div class="src-line"><a name="a252"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>$lastInstruction&nbsp;</strong>=&nbsp;<a href="http://www.php.net/substr">substr</a><strong>(</strong><strong>$bytecode</strong><strong>,&nbsp;</strong>-2<strong>)</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a253"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a254"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="blue">if&nbsp;</font><strong>(&nbsp;</strong><strong>$lastInstruction&nbsp;</strong>==&nbsp;<a href="../SWX/_SwfCompiler.php.html#defineACTION_INIT_OBJECT">ACTION_INIT_OBJECT</a>&nbsp;||&nbsp;<strong>$lastInstruction&nbsp;</strong>==&nbsp;<a href="../SWX/_SwfCompiler.php.html#defineACTION_INIT_ARRAY">ACTION_INIT_ARRAY</a><strong>)</strong></div></li>
<li><div class="src-line"><a name="a255"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>{</strong></div></li>
<li><div class="src-line"><a name="a256"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//error_log('IS&nbsp;COMPLEX&nbsp;-&nbsp;'.$lastInstruction);</font></div></li>
<li><div class="src-line"><a name="a257"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>$bytecodeLenInDec&nbsp;</strong>-=&nbsp;1<strong>;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</strong></div></li>
<li><div class="src-line"><a name="a258"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>}</strong></div></li>
<li><div class="src-line"><a name="a259"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a260"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;If&nbsp;we&nbsp;haven't&nbsp;written&nbsp;any&nbsp;bytecode&nbsp;into&nbsp;the&nbsp;local</font></div></li>
<li><div class="src-line"><a name="a261"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;buffer&nbsp;yet&nbsp;(if&nbsp;it's&nbsp;empty),&nbsp;don't&nbsp;write&nbsp;a&nbsp;push&nbsp;statement.&nbsp;</font></div></li>
<li><div class="src-line"><a name="a262"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="blue">if&nbsp;</font><strong>(</strong><strong>$bytecodeLenInDec&nbsp;</strong>!=&nbsp;-1&nbsp;&amp;&amp;&nbsp;<strong>$bytecodeLenInDec&nbsp;</strong>!=&nbsp;0<strong>)</strong></div></li>
<li><div class="src-line"><a name="a263"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>{</strong></div></li>
<li><div class="src-line"><a name="a264"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;TODO:&nbsp;Refactor&nbsp;-&nbsp;pull&nbsp;out</font></div></li>
<li><div class="src-line"><a name="a265"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>$bytecodeLenInHex&nbsp;</strong>=&nbsp;<strong>$this</strong><strong>-&gt;</strong><a href="../SWX/SwfCompiler.html#methodgetIntAsHex">getIntAsHex</a><strong>(</strong><strong>$bytecodeLenInDec</strong><strong>,&nbsp;</strong>2<strong>)</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a266"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>$bytecode&nbsp;</strong>=&nbsp;<strong>$bytecodeLenInHex&nbsp;</strong>.&nbsp;<strong>$bytecode</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a267"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>$bytecode&nbsp;</strong>=&nbsp;<font color="#66cccc">'96'&nbsp;</font>.&nbsp;<strong>$bytecode</strong><strong>;&nbsp;&nbsp;&nbsp;&nbsp;</strong><font color="green">//&nbsp;Push.&nbsp;TODO:&nbsp;Replace&nbsp;w.&nbsp;constant</font></div></li>
<li><div class="src-line"><a name="a268"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>}</strong></div></li>
<li><div class="src-line"><a name="a269"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a270"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;Store&nbsp;current&nbsp;instruction&nbsp;on&nbsp;the&nbsp;stack</font></div></li>
<li><div class="src-line"><a name="a271"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>$this</strong><strong>-&gt;</strong><a href="../SWX/SwfCompiler.html#var$stack">stack</a>&nbsp;=&nbsp;<strong>$bytecode&nbsp;</strong>.&nbsp;<strong>$this</strong><strong>-&gt;</strong><a href="../SWX/SwfCompiler.html#var$stack">stack</a><strong>;</strong></div></li>
<li><div class="src-line"><a name="a272"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a273"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;Reset&nbsp;the&nbsp;bytecode</font></div></li>
<li><div class="src-line"><a name="a274"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>$bytecode&nbsp;</strong>=&nbsp;<font color="#66cccc">''</font><strong>;</strong></div></li>
<li><div class="src-line"><a name="a275"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a276"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;Add&nbsp;the&nbsp;found&nbsp;array&nbsp;to&nbsp;the&nbsp;stack</font></div></li>
<li><div class="src-line"><a name="a277"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>$this</strong><strong>-&gt;</strong><a href="../SWX/SwfCompiler.html#methodarrayToBytecode">arrayToBytecode</a><strong>(</strong><strong>$value</strong><strong>)</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a278"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a279"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;If&nbsp;this&nbsp;is&nbsp;an&nbsp;element&nbsp;from&nbsp;an&nbsp;associative&nbsp;array,&nbsp;push&nbsp;the</font></div></li>
<li><div class="src-line"><a name="a280"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;key&nbsp;before&nbsp;you&nbsp;recurse:</font></div></li>
<li><div class="src-line"><a name="a281"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="blue">if&nbsp;</font><strong>(</strong><strong>$arrayType&nbsp;</strong>==&nbsp;<a href="../SWX/_SwfCompiler.php.html#defineARRAY_TYPE_ASSOCIATIVE">ARRAY_TYPE_ASSOCIATIVE</a><strong>)</strong></div></li>
<li><div class="src-line"><a name="a282"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>{</strong></div></li>
<li><div class="src-line"><a name="a283"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>$bytecode&nbsp;</strong>=&nbsp;<strong>$this</strong><strong>-&gt;</strong><a href="../SWX/SwfCompiler.html#methoddataToBytecode">dataToBytecode</a><strong>(</strong><strong>$key</strong><strong>)&nbsp;</strong>.&nbsp;<strong>$bytecode</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a284"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>}</strong></div></li>
<li><div class="src-line"><a name="a285"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a286"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>}</strong></div></li>
<li><div class="src-line"><a name="a287"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else</div></li>
<li><div class="src-line"><a name="a288"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>{</strong></div></li>
<li><div class="src-line"><a name="a289"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;Simple&nbsp;data&nbsp;type</font></div></li>
<li><div class="src-line"><a name="a290"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a291"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;What&nbsp;type&nbsp;of&nbsp;array&nbsp;are&nbsp;we?</font></div></li>
<li><div class="src-line"><a name="a292"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="blue">if&nbsp;</font><strong>(</strong><strong>$arrayType&nbsp;</strong>==&nbsp;<a href="../SWX/_SwfCompiler.php.html#defineARRAY_TYPE_REGULAR">ARRAY_TYPE_REGULAR</a><strong>)</strong></div></li>
<li><div class="src-line"><a name="a293"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>{</strong></div></li>
<li><div class="src-line"><a name="a294"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;Regular</font></div></li>
<li><div class="src-line"><a name="a295"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>$bytecode&nbsp;</strong>=&nbsp;<strong>$this</strong><strong>-&gt;</strong><a href="../SWX/SwfCompiler.html#methoddataToBytecode">dataToBytecode</a><strong>(</strong><strong>$value</strong><strong>)</strong>.<strong>$bytecode</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a296"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>}</strong></div></li>
<li><div class="src-line"><a name="a297"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else</div></li>
<li><div class="src-line"><a name="a298"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>{</strong></div></li>
<li><div class="src-line"><a name="a299"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;Associative&nbsp;(in&nbsp;Flash:&nbsp;object)</font></div></li>
<li><div class="src-line"><a name="a300"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>$bytecode&nbsp;</strong>=&nbsp;<strong>$this</strong><strong>-&gt;</strong><a href="../SWX/SwfCompiler.html#methoddataToBytecode">dataToBytecode</a><strong>(</strong><strong>$key</strong><strong>)</strong></div></li>
<li><div class="src-line"><a name="a301"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.<strong>$this</strong><strong>-&gt;</strong><a href="../SWX/SwfCompiler.html#methoddataToBytecode">dataToBytecode</a><strong>(</strong><strong>$value</strong><strong>)&nbsp;</strong></div></li>
<li><div class="src-line"><a name="a302"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.<strong>$bytecode</strong><strong>;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</strong></div></li>
<li><div class="src-line"><a name="a303"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>}</strong></div></li>
<li><div class="src-line"><a name="a304"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>}</strong></div></li>
<li><div class="src-line"><a name="a305"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>}</strong></div></li>
<li><div class="src-line"><a name="a306"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a307"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;Profiling:</font></div></li>
<li><div class="src-line"><a name="a308"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;error_log(&quot;For&nbsp;loop&nbsp;took&quot;&nbsp;.&nbsp;(microtime_float()-$forLoopStartTime));</font></div></li>
<li><div class="src-line"><a name="a309"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a310"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a311"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="blue">if&nbsp;</font><strong>(</strong><strong>$bytecode&nbsp;</strong>!=&nbsp;<font color="#66cccc">''</font><strong>)</strong></div></li>
<li><div class="src-line"><a name="a312"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>{</strong></div></li>
<li><div class="src-line"><a name="a313"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>$bytecodeLenInDec&nbsp;</strong>=&nbsp;<a href="http://www.php.net/strlen">strlen</a><strong>(</strong><strong>$bytecode</strong><strong>)</strong>/2<strong>;</strong></div></li>
<li><div class="src-line"><a name="a314"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a315"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;TODO:&nbsp;Refactor&nbsp;-&nbsp;Pull&nbsp;out&nbsp;</font></div></li>
<li><div class="src-line"><a name="a316"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a317"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;Calculate&nbsp;bytecode&nbsp;length&nbsp;*without*&nbsp;counting&nbsp;the&nbsp;</font></div></li>
<li><div class="src-line"><a name="a318"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;init&nbsp;object&nbsp;or&nbsp;init&nbsp;array&nbsp;action</font></div></li>
<li><div class="src-line"><a name="a319"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>$lastInstruction&nbsp;</strong>=&nbsp;<a href="http://www.php.net/substr">substr</a><strong>(</strong><strong>$bytecode</strong><strong>,&nbsp;</strong>-2<strong>)</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a320"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="blue">if&nbsp;</font><strong>(&nbsp;</strong><strong>$lastInstruction&nbsp;</strong>==&nbsp;<a href="../SWX/_SwfCompiler.php.html#defineACTION_INIT_OBJECT">ACTION_INIT_OBJECT</a>&nbsp;||&nbsp;<strong>$lastInstruction&nbsp;</strong>==&nbsp;<a href="../SWX/_SwfCompiler.php.html#defineACTION_INIT_ARRAY">ACTION_INIT_ARRAY</a><strong>)</strong></div></li>
<li><div class="src-line"><a name="a321"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>{</strong></div></li>
<li><div class="src-line"><a name="a322"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//error_log('(at&nbsp;end)&nbsp;IS&nbsp;COMPLEX&nbsp;-&nbsp;'.$lastInstruction);</font></div></li>
<li><div class="src-line"><a name="a323"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>$bytecodeLenInDec&nbsp;</strong>-=&nbsp;1<strong>;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</strong></div></li>
<li><div class="src-line"><a name="a324"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>}</strong></div></li>
<li><div class="src-line"><a name="a325"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a326"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;TODO:&nbsp;Refactor&nbsp;-&nbsp;pull&nbsp;this&nbsp;out&nbsp;into&nbsp;its&nbsp;own&nbsp;method&nbsp;now&nbsp;that</font></div></li>
<li><div class="src-line"><a name="a327"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;it&nbsp;is&nbsp;being&nbsp;used&nbsp;at&nbsp;the&nbsp;start&nbsp;of&nbsp;the&nbsp;loop&nbsp;also.</font></div></li>
<li><div class="src-line"><a name="a328"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>$bytecodeLenInHex&nbsp;</strong>=&nbsp;<strong>$this</strong><strong>-&gt;</strong><a href="../SWX/SwfCompiler.html#methodgetIntAsHex">getIntAsHex</a><strong>(</strong><strong>$bytecodeLenInDec</strong><strong>,&nbsp;</strong>2<strong>)</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a329"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>$bytecode&nbsp;</strong>=&nbsp;<strong>$bytecodeLenInHex&nbsp;</strong>.&nbsp;<strong>$bytecode</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a330"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>$bytecode&nbsp;</strong>=&nbsp;<font color="#66cccc">'96'&nbsp;</font>.&nbsp;<strong>$bytecode</strong><strong>;&nbsp;&nbsp;&nbsp;&nbsp;</strong><font color="green">//&nbsp;Push.&nbsp;TODO:&nbsp;Replace&nbsp;w.&nbsp;constant</font></div></li>
<li><div class="src-line"><a name="a331"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a332"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;Store&nbsp;current&nbsp;instruction&nbsp;on&nbsp;the&nbsp;stack</font></div></li>
<li><div class="src-line"><a name="a333"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>$this</strong><strong>-&gt;</strong><a href="../SWX/SwfCompiler.html#var$stack">stack</a>&nbsp;=&nbsp;<strong>$bytecode&nbsp;</strong>.&nbsp;<strong>$this</strong><strong>-&gt;</strong><a href="../SWX/SwfCompiler.html#var$stack">stack</a><strong>;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</strong></div></li>
<li><div class="src-line"><a name="a334"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>}</strong></div></li>
<li><div class="src-line"><a name="a335"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else</div></li>
<li><div class="src-line"><a name="a336"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>{</strong></div></li>
<li><div class="src-line"><a name="a337"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//error_log('Bytecode&nbsp;is&nbsp;empty,&nbsp;skipping...');</font></div></li>
<li><div class="src-line"><a name="a338"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>}</strong></div></li>
<li><div class="src-line"><a name="a339"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a340"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//error_log('Returning&nbsp;stack:&nbsp;'&nbsp;.&nbsp;$this-&gt;stack);</font></div></li>
<li><div class="src-line"><a name="a341"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a342"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="blue">return&nbsp;</font><strong>$this</strong><strong>-&gt;</strong><a href="../SWX/SwfCompiler.html#var$stack">stack</a><strong>;</strong></div></li>
<li><div class="src-line"><a name="a343"></a>&nbsp;&nbsp;&nbsp;&nbsp;<strong>}</strong></div></li>
<li><div class="src-line"><a name="a344"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a345"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a346"></a>&nbsp;&nbsp;&nbsp;&nbsp;<font color="#009999">/**</font></div></li>
<li><div class="src-line"><a name="a347"></a><font color="#009999">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Converts&nbsp;the&nbsp;passed&nbsp;string&nbsp;to&nbsp;hex&nbsp;and&nbsp;returns&nbsp;the&nbsp;correct&nbsp;SWF&nbsp;bytecode&nbsp;for&nbsp;it.</font></div></li>
<li><div class="src-line"><a name="a348"></a><font color="#009999">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</font></div></li>
<li><div class="src-line"><a name="a349"></a><font color="#009999">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</font><strong><font color = "#0099FF">@param&nbsp;</font></strong><font color="#009999">&nbsp;&nbsp;&nbsp;&nbsp;</font><em>string&nbsp;</em><font color="#009999">&nbsp;&nbsp;&nbsp;The&nbsp;string&nbsp;to&nbsp;convert&nbsp;to&nbsp;bytecode.</font></div></li>
<li><div class="src-line"><a name="a350"></a><font color="#009999">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</font><strong><font color = "#0099FF">@return&nbsp;</font></strong><font color="#009999">&nbsp;&nbsp;&nbsp;&nbsp;</font><em>string&nbsp;</em><font color="#009999">&nbsp;&nbsp;&nbsp;SWF&nbsp;bytecode&nbsp;for&nbsp;the&nbsp;passed&nbsp;string</font></div></li>
<li><div class="src-line"><a name="a351"></a><font color="#009999">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</font><strong><font color = "#0099FF">@author</font></strong><font color="#009999">&nbsp;Aral&nbsp;Balkan</font></div></li>
<li><div class="src-line"><a name="a352"></a><font color="#009999">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;***/</font></div></li>
<li><div class="src-line"><a name="a353"></a>&nbsp;&nbsp;&nbsp;&nbsp;<font color="blue">function&nbsp;</font><a href="../SWX/SwfCompiler.html#methodstringToBytecode">stringToBytecode</a>&nbsp;<strong>(</strong><strong>$str</strong><strong>)</strong></div></li>
<li><div class="src-line"><a name="a354"></a>&nbsp;&nbsp;&nbsp;&nbsp;<strong>{</strong></div></li>
<li><div class="src-line"><a name="a355"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>$bytecode&nbsp;</strong>=&nbsp;<a href="http://www.php.net/strtoupper">strtoupper</a><strong>(</strong><a href="../SWX/_SwfCompiler.php.html#defineDATA_TYPE_STRING">DATA_TYPE_STRING</a>&nbsp;.&nbsp;<strong>$this</strong><strong>-&gt;</strong><a href="../SWX/SwfCompiler.html#methodstrhex">strhex</a><strong>(</strong><strong>$str</strong><strong>)&nbsp;</strong>.&nbsp;<a href="../SWX/_SwfCompiler.php.html#defineNULL_TERMINATOR">NULL_TERMINATOR</a><strong>)</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a356"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a357"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="blue">return&nbsp;</font><strong>$bytecode</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a358"></a>&nbsp;&nbsp;&nbsp;&nbsp;<strong>}</strong></div></li>
<li><div class="src-line"><a name="a359"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a360"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a361"></a>&nbsp;&nbsp;&nbsp;&nbsp;<font color="#009999">/**</font></div></li>
<li><div class="src-line"><a name="a362"></a><font color="#009999">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Converts&nbsp;the&nbsp;passed&nbsp;integer&nbsp;to&nbsp;bytecode,&nbsp;padding&nbsp;it&nbsp;to</font></div></li>
<li><div class="src-line"><a name="a363"></a><font color="#009999">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;$numBytes&nbsp;bytes&nbsp;in&nbsp;little-endian.</font></div></li>
<li><div class="src-line"><a name="a364"></a><font color="#009999">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</font></div></li>
<li><div class="src-line"><a name="a365"></a><font color="#009999">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</font><strong><font color = "#0099FF">@param&nbsp;</font></strong><em>integer&nbsp;</em><font color="#009999">&nbsp;&nbsp;&nbsp;&nbsp;Number&nbsp;to&nbsp;convert&nbsp;to&nbsp;hex&nbsp;byte&nbsp;representation.</font></div></li>
<li><div class="src-line"><a name="a366"></a><font color="#009999">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</font><strong><font color = "#0099FF">@param&nbsp;</font></strong><em>integer&nbsp;</em><font color="#009999">&nbsp;&nbsp;&nbsp;Number&nbsp;of&nbsp;bytes&nbsp;to&nbsp;pad&nbsp;to.</font></div></li>
<li><div class="src-line"><a name="a367"></a><font color="#009999">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</font><strong><font color = "#0099FF">@return&nbsp;</font></strong><em>string&nbsp;</em><font color="#009999">&nbsp;&nbsp;&nbsp;&nbsp;Integer&nbsp;as&nbsp;hex&nbsp;string.</font></div></li>
<li><div class="src-line"><a name="a368"></a><font color="#009999">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</font><strong><font color = "#0099FF">@author</font></strong><font color="#009999">&nbsp;Aral&nbsp;Balkan</font></div></li>
<li><div class="src-line"><a name="a369"></a><font color="#009999">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;***/</font></div></li>
<li><div class="src-line"><a name="a370"></a>&nbsp;&nbsp;&nbsp;&nbsp;<font color="blue">function&nbsp;</font><a href="../SWX/SwfCompiler.html#methodintegerToBytecode">integerToBytecode</a><strong>(</strong><strong>$int</strong><strong>)</strong></div></li>
<li><div class="src-line"><a name="a371"></a>&nbsp;&nbsp;&nbsp;&nbsp;<strong>{</strong></div></li>
<li><div class="src-line"><a name="a372"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>$bytecode&nbsp;</strong>=&nbsp;<a href="../SWX/_SwfCompiler.php.html#defineDATA_TYPE_INTEGER">DATA_TYPE_INTEGER</a>&nbsp;.&nbsp;<strong>$this</strong><strong>-&gt;</strong><a href="../SWX/SwfCompiler.html#methodgetIntAsHex">getIntAsHex</a><strong>(</strong><strong>$int</strong><strong>,&nbsp;</strong>4<strong>)</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a373"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="blue">return&nbsp;</font><strong>$bytecode</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a374"></a>&nbsp;&nbsp;&nbsp;&nbsp;<strong>}</strong></div></li>
<li><div class="src-line"><a name="a375"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a376"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a377"></a>&nbsp;&nbsp;&nbsp;&nbsp;<font color="#009999">/**</font></div></li>
<li><div class="src-line"><a name="a378"></a><font color="#009999">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Converts&nbsp;a&nbsp;double&nbsp;to&nbsp;its&nbsp;IEEE&nbsp;754&nbsp;representation&nbsp;(little-endian)</font></div></li>
<li><div class="src-line"><a name="a379"></a><font color="#009999">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</font></div></li>
<li><div class="src-line"><a name="a380"></a><font color="#009999">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Modified&nbsp;from&nbsp;Chung&nbsp;Leong's&nbsp;function.</font></div></li>
<li><div class="src-line"><a name="a381"></a><font color="#009999">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;(http://www.thescripts.com/forum/thread9237.html.)</font></div></li>
<li><div class="src-line"><a name="a382"></a><font color="#009999">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</font></div></li>
<li><div class="src-line"><a name="a383"></a><font color="#009999">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;TODO:&nbsp;Works&nbsp;on&nbsp;5.1.2&nbsp;for&nbsp;me&nbsp;(OS&nbsp;X&nbsp;10.4.9,&nbsp;Intel&nbsp;Core&nbsp;Duo,&nbsp;MAMP&nbsp;1.2.1)&nbsp;but</font></div></li>
<li><div class="src-line"><a name="a384"></a><font color="#009999">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;waiting&nbsp;for&nbsp;report&nbsp;back&nbsp;from&nbsp;Alex&nbsp;Skinner&nbsp;for&nbsp;whom&nbsp;it&nbsp;is&nbsp;not&nbsp;working.&nbsp;Weird!</font></div></li>
<li><div class="src-line"><a name="a385"></a><font color="#009999">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</font></div></li>
<li><div class="src-line"><a name="a386"></a><font color="#009999">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</font><strong><font color = "#0099FF">@param&nbsp;</font></strong><font color="#009999">&nbsp;&nbsp;&nbsp;&nbsp;</font><em>double&nbsp;</em><font color="#009999">&nbsp;&nbsp;&nbsp;A&nbsp;PHP&nbsp;double.</font></div></li>
<li><div class="src-line"><a name="a387"></a><font color="#009999">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</font><strong><font color = "#0099FF">@return&nbsp;</font></strong><font color="#009999">&nbsp;&nbsp;&nbsp;&nbsp;</font><em>string&nbsp;</em><font color="#009999">&nbsp;&nbsp;&nbsp;Little-endian&nbsp;Flash&nbsp;double&nbsp;in&nbsp;hex&nbsp;(variation&nbsp;on&nbsp;IEEE&nbsp;754).</font></div></li>
<li><div class="src-line"><a name="a388"></a><font color="#009999">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</font><strong><font color = "#0099FF">@author</font></strong><font color="#009999">&nbsp;Aral&nbsp;Balkan</font></div></li>
<li><div class="src-line"><a name="a389"></a><font color="#009999">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;***/</font></div></li>
<li><div class="src-line"><a name="a390"></a>&nbsp;&nbsp;&nbsp;&nbsp;<font color="blue">function&nbsp;</font><a href="../SWX/SwfCompiler.html#methoddoubleToBytecode">doubleToBytecode</a><strong>(</strong><strong>$f</strong><strong>)&nbsp;</strong></div></li>
<li><div class="src-line"><a name="a391"></a>&nbsp;&nbsp;&nbsp;&nbsp;<strong>{</strong></div></li>
<li><div class="src-line"><a name="a392"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="blue">global&nbsp;</font><strong>$endian</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a393"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a394"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>$f&nbsp;</strong>=&nbsp;(double)&nbsp;<strong>$f</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a395"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>$b&nbsp;</strong>=&nbsp;<a href="http://www.php.net/pack">pack</a><strong>(</strong><font color="#66cccc">&quot;d&quot;</font><strong>,&nbsp;</strong><strong>$f</strong><strong>)</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a396"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>$hex&nbsp;</strong>=&nbsp;<font color="#66cccc">&quot;&quot;</font><strong>;</strong></div></li>
<li><div class="src-line"><a name="a397"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a398"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;This&nbsp;test&nbsp;is&nbsp;here&nbsp;for&nbsp;PowerPC&nbsp;Macs&nbsp;which&nbsp;are&nbsp;bi-endian.</font></div></li>
<li><div class="src-line"><a name="a399"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="blue">if&nbsp;</font><strong>(</strong><strong>$endian&nbsp;</strong>==&nbsp;<a href="../SWX/_SwfCompiler.php.html#defineBI_ENDIAN">BI_ENDIAN</a><strong>)</strong></div></li>
<li><div class="src-line"><a name="a400"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>{</strong></div></li>
<li><div class="src-line"><a name="a401"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>$b&nbsp;</strong>=&nbsp;<a href="http://www.php.net/strrev">strrev</a><strong>(</strong><strong>$b</strong><strong>)</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a402"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>}</strong></div></li>
<li><div class="src-line"><a name="a403"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a404"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="blue">for</font><strong>(</strong><strong>$i&nbsp;</strong>=&nbsp;0<strong>;&nbsp;</strong><strong>$i&nbsp;</strong>&lt;&nbsp;<a href="http://www.php.net/strlen">strlen</a><strong>(</strong><strong>$b</strong><strong>)</strong><strong>;&nbsp;</strong><strong>$i</strong>++<strong>)&nbsp;</strong></div></li>
<li><div class="src-line"><a name="a405"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>{</strong></div></li>
<li><div class="src-line"><a name="a406"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>$c&nbsp;</strong>=&nbsp;<a href="http://www.php.net/ord">ord</a><strong>(</strong><strong>$b</strong><strong>{</strong><strong>$i</strong><strong>}</strong><strong>)</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a407"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a408"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>$hex&nbsp;</strong>.=&nbsp;<a href="http://www.php.net/sprintf">sprintf</a><strong>(</strong><font color="#66cccc">&quot;%02X&quot;</font><strong>,&nbsp;</strong><strong>$c</strong><strong>)</strong><strong>;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</strong></div></li>
<li><div class="src-line"><a name="a409"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>}&nbsp;</strong></div></li>
<li><div class="src-line"><a name="a410"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a411"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>$hex&nbsp;</strong>=&nbsp;<a href="http://www.php.net/substr">substr</a><strong>(</strong><strong>$hex</strong><strong>,&nbsp;</strong>8<strong>,&nbsp;</strong>8<strong>)</strong>.<a href="http://www.php.net/substr">substr</a><strong>(</strong><strong>$hex</strong><strong>,&nbsp;</strong>0<strong>,&nbsp;</strong>8<strong>)</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a412"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a413"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="blue">return&nbsp;</font><a href="../SWX/_SwfCompiler.php.html#defineDATA_TYPE_DOUBLE">DATA_TYPE_DOUBLE</a>&nbsp;.&nbsp;<strong>$hex</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a414"></a>&nbsp;&nbsp;&nbsp;&nbsp;<strong>}</strong></div></li>
<li><div class="src-line"><a name="a415"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a416"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a417"></a>&nbsp;&nbsp;&nbsp;&nbsp;<font color="#009999">/**</font></div></li>
<li><div class="src-line"><a name="a418"></a><font color="#009999">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Converts&nbsp;the&nbsp;passed&nbsp;boolean&nbsp;to&nbsp;SWF&nbsp;bytecode.</font></div></li>
<li><div class="src-line"><a name="a419"></a><font color="#009999">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</font></div></li>
<li><div class="src-line"><a name="a420"></a><font color="#009999">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</font><strong><font color = "#0099FF">@return&nbsp;</font></strong><em>string&nbsp;</em><font color="#009999">&nbsp;&nbsp;&nbsp;Boolean&nbsp;as&nbsp;SWF&nbsp;bytecode.</font></div></li>
<li><div class="src-line"><a name="a421"></a><font color="#009999">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</font><strong><font color = "#0099FF">@author</font></strong><font color="#009999">&nbsp;Aral&nbsp;Balkan</font></div></li>
<li><div class="src-line"><a name="a422"></a><font color="#009999">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;***/</font></div></li>
<li><div class="src-line"><a name="a423"></a>&nbsp;&nbsp;&nbsp;&nbsp;<font color="blue">function&nbsp;</font><a href="../SWX/SwfCompiler.html#methodbooleanToBytecode">booleanToBytecode</a>&nbsp;<strong>(</strong><strong>$bool</strong><strong>)</strong></div></li>
<li><div class="src-line"><a name="a424"></a>&nbsp;&nbsp;&nbsp;&nbsp;<strong>{</strong></div></li>
<li><div class="src-line"><a name="a425"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>$boolBytecode&nbsp;</strong>=&nbsp;<a href="../SWX/_SwfCompiler.php.html#defineDATA_TYPE_BOOLEAN">DATA_TYPE_BOOLEAN</a>&nbsp;.&nbsp;<strong>(</strong><strong>$bool&nbsp;</strong>?&nbsp;<font color="#66cccc">'01'</font>:<font color="#66cccc">'00'</font><strong>)</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a426"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="blue">return&nbsp;</font><strong>$boolBytecode</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a427"></a>&nbsp;&nbsp;&nbsp;&nbsp;<strong>}</strong></div></li>
<li><div class="src-line"><a name="a428"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a429"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a430"></a>&nbsp;&nbsp;&nbsp;&nbsp;<font color="#009999">/**</font></div></li>
<li><div class="src-line"><a name="a431"></a><font color="#009999">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Wraps&nbsp;the&nbsp;SWF&nbsp;buffer&nbsp;in&nbsp;a&nbsp;doAction&nbsp;block,&nbsp;wraps&nbsp;that&nbsp;with</font></div></li>
<li><div class="src-line"><a name="a432"></a><font color="#009999">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;the&nbsp;SWF&nbsp;Header&nbsp;and&nbsp;the&nbsp;SWF&nbsp;footer&nbsp;(set&nbsp;variable,&nbsp;show&nbsp;frame,&nbsp;end&nbsp;SWF)</font></div></li>
<li><div class="src-line"><a name="a433"></a><font color="#009999">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;and&nbsp;writes&nbsp;out&nbsp;the&nbsp;SWF.</font></div></li>
<li><div class="src-line"><a name="a434"></a><font color="#009999">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</font></div></li>
<li><div class="src-line"><a name="a435"></a><font color="#009999">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;</font><strong><font color = "#0099FF">@param&nbsp;</font></strong><font color="#009999">&nbsp;&nbsp;&nbsp;&nbsp;</font><em>Data&nbsp;</em><font color="#009999">to&nbsp;write&nbsp;out&nbsp;as&nbsp;a&nbsp;SWF.</font></div></li>
<li><div class="src-line"><a name="a436"></a><font color="#009999">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;</font><strong><font color = "#0099FF">@return&nbsp;</font></strong><em>void&nbsp;</em></div></li>
<li><div class="src-line"><a name="a437"></a><font color="#009999">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</font><strong><font color = "#0099FF">@author</font></strong><font color="#009999">&nbsp;Aral&nbsp;Balkan</font></div></li>
<li><div class="src-line"><a name="a438"></a><font color="#009999">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;***/</font></div></li>
<li><div class="src-line"><a name="a439"></a>&nbsp;&nbsp;&nbsp;&nbsp;<font color="blue">function&nbsp;</font><a href="../SWX/SwfCompiler.html#methodwriteSwf">writeSwf</a><strong>(</strong><strong>$data</strong><strong>,&nbsp;</strong><strong>$debug&nbsp;</strong>=&nbsp;false<strong>,&nbsp;</strong><strong>$compressionLevel&nbsp;</strong>=&nbsp;4<strong>,&nbsp;</strong><strong>$url&nbsp;</strong>=&nbsp;<font color="#66cccc">''</font><strong>)</strong></div></li>
<li><div class="src-line"><a name="a440"></a>&nbsp;&nbsp;&nbsp;&nbsp;<strong>{</strong></div></li>
<li><div class="src-line"><a name="a441"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="blue">global&nbsp;</font><strong>$allowDomain</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a442"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a443"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;If&nbsp;the&nbsp;passed&nbsp;data&nbsp;structure&nbsp;is&nbsp;not&nbsp;an&nbsp;array,&nbsp;</font></div></li>
<li><div class="src-line"><a name="a444"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;convert&nbsp;it&nbsp;to&nbsp;one.</font></div></li>
<li><div class="src-line"><a name="a445"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="blue">if&nbsp;</font><strong>(</strong><a href="http://www.php.net/gettype">gettype</a><strong>(</strong><strong>$data</strong><strong>)&nbsp;</strong>!=&nbsp;<font color="#66cccc">'array'</font><strong>)</strong></div></li>
<li><div class="src-line"><a name="a446"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>{</strong></div></li>
<li><div class="src-line"><a name="a447"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;Result&nbsp;is&nbsp;not&nbsp;an&nbsp;array,&nbsp;making&nbsp;it&nbsp;so.</font></div></li>
<li><div class="src-line"><a name="a448"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>$data&nbsp;</strong>=&nbsp;array<strong>(</strong><strong>$data</strong><strong>)</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a449"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>}</strong></div></li>
<li><div class="src-line"><a name="a450"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a451"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;Check&nbsp;data&nbsp;root</font></div></li>
<li><div class="src-line"><a name="a452"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="blue">if&nbsp;</font><strong>(</strong><a href="http://www.php.net/gettype">gettype</a><strong>(</strong><strong>$data</strong><strong>)&nbsp;</strong>==&nbsp;<font color="#66cccc">'array'</font><strong>)</strong></div></li>
<li><div class="src-line"><a name="a453"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>{</strong></div></li>
<li><div class="src-line"><a name="a454"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>$pushTag&nbsp;</strong>=&nbsp;<strong>$this</strong><strong>-&gt;</strong><a href="../SWX/SwfCompiler.html#methodarrayToBytecode">arrayToBytecode</a><strong>(</strong><strong>$data</strong><strong>)</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a455"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a456"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;Add&nbsp;the&nbsp;'data'&nbsp;variable&nbsp;name&nbsp;--&nbsp;either</font></div></li>
<li><div class="src-line"><a name="a457"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;using&nbsp;the&nbsp;constant&nbsp;table&nbsp;if&nbsp;in&nbsp;debug&nbsp;mode</font></div></li>
<li><div class="src-line"><a name="a458"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;or&nbsp;as&nbsp;a&nbsp;regular&nbsp;string&nbsp;otherwise</font></div></li>
<li><div class="src-line"><a name="a459"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="blue">if&nbsp;</font><strong>(</strong><strong>$debug</strong><strong>)</strong></div></li>
<li><div class="src-line"><a name="a460"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>{</strong></div></li>
<li><div class="src-line"><a name="a461"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>$pushTag&nbsp;</strong>=&nbsp;<font color="#66cccc">'9602000800'&nbsp;</font>.&nbsp;<strong>$pushTag</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a462"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>}</strong></div></li>
<li><div class="src-line"><a name="a463"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else</div></li>
<li><div class="src-line"><a name="a464"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>{</strong></div></li>
<li><div class="src-line"><a name="a465"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>$pushTag&nbsp;</strong>=&nbsp;<font color="#66cccc">'96080000726573756C7400'&nbsp;</font>.&nbsp;<strong>$pushTag</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a466"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>}</strong></div></li>
<li><div class="src-line"><a name="a467"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>}</strong></div></li>
<li><div class="src-line"><a name="a468"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a469"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;Create&nbsp;the&nbsp;DoAction&nbsp;tag</font></div></li>
<li><div class="src-line"><a name="a470"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>$doActionBlock&nbsp;</strong>=&nbsp;<strong>$pushTag</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a471"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a472"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>$doActionBlock&nbsp;</strong>.=&nbsp;<a href="../SWX/_SwfCompiler.php.html#defineACTION_SET_VARIABLE">ACTION_SET_VARIABLE</a><strong>;</strong></div></li>
<li><div class="src-line"><a name="a473"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a474"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;Allow&nbsp;domain?&nbsp;If&nbsp;so&nbsp;add&nbsp;allow&nbsp;domain&nbsp;statement&nbsp;to&nbsp;the&nbsp;SWF</font></div></li>
<li><div class="src-line"><a name="a475"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="blue">if&nbsp;</font><strong>(</strong><strong>$allowDomain&nbsp;</strong>===&nbsp;true<strong>)</strong></div></li>
<li><div class="src-line"><a name="a476"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>{</strong></div></li>
<li><div class="src-line"><a name="a477"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.php.net/error_log">error_log</a><strong>(</strong><font color="#66cccc">&quot;[SWX]&nbsp;INFO&nbsp;Allow&nbsp;domain&nbsp;is&nbsp;on.&quot;</font><strong>)</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a478"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a479"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>$doActionBlock&nbsp;</strong>=&nbsp;<strong>$doActionBlock&nbsp;</strong>.&nbsp;<strong>$this</strong><strong>-&gt;</strong><a href="../SWX/SwfCompiler.html#methodgetAllowDomainBytecode">getAllowDomainBytecode</a><strong>(</strong><strong>$url</strong><strong>)</strong><strong>;&nbsp;</strong><font color="green">//&nbsp;ALLOW_DOMAIN;</font></div></li>
<li><div class="src-line"><a name="a480"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>}</strong></div></li>
<li><div class="src-line"><a name="a481"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a482"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;Debug?&nbsp;If&nbsp;so,&nbsp;add&nbsp;the&nbsp;analyzer&nbsp;connector&nbsp;to&nbsp;the&nbsp;SWF</font></div></li>
<li><div class="src-line"><a name="a483"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="blue">if&nbsp;</font><strong>(</strong><strong>$debug</strong><strong>)</strong></div></li>
<li><div class="src-line"><a name="a484"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>{</strong></div></li>
<li><div class="src-line"><a name="a485"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.php.net/error_log">error_log</a><strong>(</strong><font color="#66cccc">'[SWX]&nbsp;INFO&nbsp;Debug&nbsp;mode&nbsp;is&nbsp;on.'</font><strong>)</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a486"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a487"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>$doActionBlock&nbsp;</strong>=&nbsp;<a href="../SWX/_SwfCompiler.php.html#defineDEBUG_START">DEBUG_START</a>&nbsp;.&nbsp;<strong>$doActionBlock&nbsp;</strong>.&nbsp;<a href="../SWX/_SwfCompiler.php.html#defineDEBUG_END">DEBUG_END</a><strong>;</strong></div></li>
<li><div class="src-line"><a name="a488"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>}</strong></div></li>
<li><div class="src-line"><a name="a489"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a490"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>$doActionBlockSizeInBytes&nbsp;</strong>=&nbsp;<strong>$this</strong><strong>-&gt;</strong><a href="../SWX/SwfCompiler.html#methodgetStringLengthInBytesHex">getStringLengthInBytesHex</a><strong>(</strong><strong>$doActionBlock</strong><strong>,&nbsp;</strong>4<strong>)</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a491"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>$doActionBlock&nbsp;</strong>=&nbsp;<a href="../SWX/_SwfCompiler.php.html#defineACTION_DO_ACTION">ACTION_DO_ACTION</a>&nbsp;.&nbsp;<strong>$doActionBlockSizeInBytes&nbsp;</strong>.&nbsp;<strong>$doActionBlock</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a492"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a493"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;Create&nbsp;the&nbsp;whole&nbsp;SWF</font></div></li>
<li><div class="src-line"><a name="a494"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a495"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>$headerType&nbsp;</strong>=&nbsp;<strong>(</strong><strong>$compressionLevel&nbsp;</strong>&gt;&nbsp;0<strong>)&nbsp;</strong>?&nbsp;<a href="../SWX/_SwfCompiler.php.html#defineCOMPRESSED_SWF">COMPRESSED_SWF</a>&nbsp;:&nbsp;<a href="../SWX/_SwfCompiler.php.html#defineUNCOMPRESSED_SWF">UNCOMPRESSED_SWF</a><strong>;</strong></div></li>
<li><div class="src-line"><a name="a496"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a497"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>$swf&nbsp;</strong>=&nbsp;&nbsp;<strong>$headerType&nbsp;</strong>.&nbsp;<a href="../SWX/_SwfCompiler.php.html#defineHEADER">HEADER</a>&nbsp;.&nbsp;<strong>$doActionBlock&nbsp;</strong>.&nbsp;<a href="../SWX/_SwfCompiler.php.html#defineACTION_SHOW_FRAME">ACTION_SHOW_FRAME</a>&nbsp;.&nbsp;<a href="../SWX/_SwfCompiler.php.html#defineACTION_END_SWF">ACTION_END_SWF</a><strong>;</strong></div></li>
<li><div class="src-line"><a name="a498"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>$swfSizeInBytes&nbsp;</strong>=&nbsp;<strong>$this</strong><strong>-&gt;</strong><a href="../SWX/SwfCompiler.html#methodgetStringLengthInBytesHex">getStringLengthInBytesHex</a><strong>(</strong><strong>$swf</strong><strong>,&nbsp;</strong>4<strong>)</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a499"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>$swf&nbsp;</strong>=&nbsp;<a href="http://www.php.net/str_replace">str_replace</a><strong>(</strong><font color="#66cccc">'LLLLLLLL'</font><strong>,&nbsp;</strong><strong>$swfSizeInBytes</strong><strong>,&nbsp;</strong><strong>$swf</strong><strong>)</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a500"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a501"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;Convert&nbsp;the&nbsp;SWF&nbsp;bytecode&nbsp;to&nbsp;a&nbsp;string&nbsp;(file)</font></div></li>
<li><div class="src-line"><a name="a502"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>$swfFile&nbsp;</strong>=&nbsp;<strong>$this</strong><strong>-&gt;</strong><a href="../SWX/SwfCompiler.html#methodhexstr">hexstr</a>&nbsp;<strong>(</strong><strong>$swf</strong><strong>)</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a503"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a504"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;Stats</font></div></li>
<li><div class="src-line"><a name="a505"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>$uncompressedSize&nbsp;</strong>=&nbsp;<a href="http://www.php.net/strlen">strlen</a><strong>(</strong><strong>$swfFile</strong><strong>)</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a506"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.php.net/error_log">error_log</a><strong>(</strong><font color="#66cccc">'[SWX]&nbsp;INFO&nbsp;Uncompressed&nbsp;size&nbsp;of&nbsp;SWF:&nbsp;'&nbsp;</font>.&nbsp;<strong>$uncompressedSize&nbsp;</strong>.&nbsp;<font color="#66cccc">'&nbsp;bytes.'</font><strong>)</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a507"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a508"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;Compress&nbsp;the&nbsp;SWF&nbsp;if&nbsp;required</font></div></li>
<li><div class="src-line"><a name="a509"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;Profiling&nbsp;info:&nbsp;Performance&nbsp;impact&nbsp;of&nbsp;compression&nbsp;is&nbsp;negligible.&nbsp;</font></div></li>
<li><div class="src-line"><a name="a510"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="blue">if&nbsp;</font><strong>(</strong><strong>$compressionLevel&nbsp;</strong>&gt;&nbsp;0<strong>)</strong></div></li>
<li><div class="src-line"><a name="a511"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>{</strong></div></li>
<li><div class="src-line"><a name="a512"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>$compressionStartTime&nbsp;</strong>=&nbsp;<strong>$this</strong><strong>-&gt;</strong><a href="../SWX/SwfCompiler.html#methodmicrotime_float">microtime_float</a><strong>(</strong><strong>)</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a513"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a514"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;The&nbsp;first&nbsp;eight&nbsp;bytes&nbsp;are&nbsp;uncompressed</font></div></li>
<li><div class="src-line"><a name="a515"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>$uncompressedBytes&nbsp;</strong>=&nbsp;<a href="http://www.php.net/substr">substr</a><strong>(</strong><strong>$swfFile</strong><strong>,&nbsp;</strong>0<strong>,&nbsp;</strong>8<strong>)</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a516"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a517"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;Remove&nbsp;first&nbsp;eight&nbsp;bytes</font></div></li>
<li><div class="src-line"><a name="a518"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>$swfFile&nbsp;</strong>=&nbsp;<a href="http://www.php.net/substr_replace">substr_replace</a><strong>(</strong><strong>$swfFile</strong><strong>,&nbsp;</strong><font color="#66cccc">''</font><strong>,&nbsp;</strong>0<strong>,&nbsp;</strong>8<strong>)</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a519"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a520"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;Compress&nbsp;the&nbsp;rest&nbsp;of&nbsp;the&nbsp;SWF</font></div></li>
<li><div class="src-line"><a name="a521"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>$swfFile&nbsp;</strong>=&nbsp;<a href="http://www.php.net/gzcompress">gzcompress</a><strong>(</strong><strong>$swfFile</strong><strong>,&nbsp;</strong><strong>$compressionLevel</strong><strong>)</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a522"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a523"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;Add&nbsp;the&nbsp;uncompressed&nbsp;header</font></div></li>
<li><div class="src-line"><a name="a524"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>$swfFile&nbsp;</strong>=&nbsp;<strong>$uncompressedBytes&nbsp;</strong>.&nbsp;<strong>$swfFile</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a525"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a526"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>$compressionDuration&nbsp;</strong>=&nbsp;<strong>$this</strong><strong>-&gt;</strong><a href="../SWX/SwfCompiler.html#methodmicrotime_float">microtime_float</a><strong>(</strong><strong>)&nbsp;</strong>-&nbsp;<strong>$compressionStartTime</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a527"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.php.net/error_log">error_log</a><strong>(</strong><font color="#66cccc">'[SWX]&nbsp;PROFILING:&nbsp;SWF&nbsp;compression&nbsp;took&nbsp;'&nbsp;</font>.&nbsp;<strong>$compressionDuration&nbsp;</strong>.&nbsp;<font color="#66cccc">'&nbsp;seconds.'</font><strong>)</strong><strong>;&nbsp;</strong></div></li>
<li><div class="src-line"><a name="a528"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a529"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;Stats</font></div></li>
<li><div class="src-line"><a name="a530"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>$compressedSize&nbsp;</strong>=&nbsp;<a href="http://www.php.net/strlen">strlen</a><strong>(</strong><strong>$swfFile</strong><strong>)</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a531"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.php.net/error_log">error_log</a><strong>(</strong><font color="#66cccc">'[SWX]&nbsp;INFO&nbsp;Compressed&nbsp;size&nbsp;of&nbsp;SWF:&nbsp;'&nbsp;</font>.&nbsp;<strong>$compressedSize&nbsp;</strong>.&nbsp;<font color="#66cccc">'&nbsp;bytes.'</font><strong>)</strong><strong>;&nbsp;</strong></div></li>
<li><div class="src-line"><a name="a532"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>}</strong></div></li>
<li><div class="src-line"><a name="a533"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a534"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.php.net/header">header</a><strong>(</strong><font color="#66cccc">&quot;Content-Type:&nbsp;application/swf;&quot;</font><strong>)</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a535"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.php.net/header">header</a><strong>(</strong><font color="#66cccc">'Content-Disposition:&nbsp;attachment;&nbsp;filename=&quot;data.swf&quot;'</font><strong>)</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a536"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.php.net/header">header</a><strong>(</strong><font color="#66cccc">'Content-Length:&nbsp;'&nbsp;</font>.&nbsp;<a href="http://www.php.net/strlen">strlen</a><strong>(</strong><strong>$swfFile</strong><strong>))</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a537"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;<strong>$swfFile</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a538"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a539"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;Enable&nbsp;the&nbsp;next&nbsp;line&nbsp;to&nbsp;write&nbsp;out&nbsp;a&nbsp;hex&nbsp;representation&nbsp;of</font></div></li>
<li><div class="src-line"><a name="a540"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;the&nbsp;SWF&nbsp;to&nbsp;the&nbsp;error&nbsp;log&nbsp;(helps&nbsp;with&nbsp;testing.)</font></div></li>
<li><div class="src-line"><a name="a541"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;error_log($this-&gt;prettyHex($swf));</font></div></li>
<li><div class="src-line"><a name="a542"></a>&nbsp;&nbsp;&nbsp;&nbsp;<strong>}</strong></div></li>
<li><div class="src-line"><a name="a543"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a544"></a>&nbsp;&nbsp;&nbsp;&nbsp;<font color="blue">function&nbsp;</font><a href="../SWX/SwfCompiler.html#methodgetAllowDomainBytecode">getAllowDomainBytecode</a><strong>(</strong><strong>$url</strong><strong>)</strong></div></li>
<li><div class="src-line"><a name="a545"></a>&nbsp;&nbsp;&nbsp;&nbsp;<strong>{</strong></div></li>
<li><div class="src-line"><a name="a546"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="blue">if&nbsp;</font><strong>(</strong><strong>$url&nbsp;</strong>===&nbsp;<font color="#66cccc">''</font><strong>)</strong></div></li>
<li><div class="src-line"><a name="a547"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>{</strong></div></li>
<li><div class="src-line"><a name="a548"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;No&nbsp;URL&nbsp;passed&nbsp;--&nbsp;possibly&nbsp;called&nbsp;by&nbsp;legacy&nbsp;code,&nbsp;use&nbsp;the&nbsp;old&nbsp;_parent._url&nbsp;version.</font></div></li>
<li><div class="src-line"><a name="a549"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.php.net/error_log">error_log</a><strong>(</strong><font color="#66cccc">'[SWX]&nbsp;INFO:&nbsp;No&nbsp;URL&nbsp;passed&nbsp;from&nbsp;client.&nbsp;Defaulting&nbsp;to&nbsp;old&nbsp;behavior.&nbsp;You&nbsp;must&nbsp;call&nbsp;System.security.allowDomain&nbsp;on&nbsp;the&nbsp;dataHolder&nbsp;for&nbsp;cross&nbsp;domain&nbsp;data&nbsp;loading&nbsp;to&nbsp;work.'</font><strong>)</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a550"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="blue">return&nbsp;</font><a href="../SWX/_SwfCompiler.php.html#defineALLOW_DOMAIN">ALLOW_DOMAIN</a><strong>;</strong></div></li>
<li><div class="src-line"><a name="a551"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>}</strong></div></li>
<li><div class="src-line"><a name="a552"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a553"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.php.net/error_log">error_log</a><strong>(</strong><font color="#66cccc">'[SWX]&nbsp;INFO:&nbsp;Data&nbsp;SWF&nbsp;will&nbsp;allow&nbsp;access&nbsp;from&nbsp;'&nbsp;</font>.&nbsp;<strong>$url</strong><strong>)</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a554"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a555"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;URL&nbsp;is&nbsp;passed,&nbsp;write&nbsp;that&nbsp;into&nbsp;the&nbsp;returned&nbsp;code</font></div></li>
<li><div class="src-line"><a name="a556"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a557"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>$allowDomainBytecode&nbsp;</strong>=&nbsp;<strong>$this</strong><strong>-&gt;</strong><a href="../SWX/SwfCompiler.html#methodstringToBytecode">stringToBytecode</a><strong>(</strong><strong>$url</strong><strong>)</strong><strong>;&nbsp;</strong></div></li>
<li><div class="src-line"><a name="a558"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a559"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;The&nbsp;-13&nbsp;is&nbsp;to&nbsp;accomodate&nbsp;the&nbsp;other&nbsp;elements&nbsp;being&nbsp;pushed&nbsp;to&nbsp;the&nbsp;</font></div></li>
<li><div class="src-line"><a name="a560"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;stack&nbsp;in&nbsp;the&nbsp;hard-coded&nbsp;part&nbsp;of&nbsp;the&nbsp;bytecode.</font></div></li>
<li><div class="src-line"><a name="a561"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>$allowDomainBytecodeLengthDec&nbsp;</strong>=&nbsp;<a href="http://www.php.net/strlen">strlen</a><strong>(</strong><strong>$allowDomainBytecode</strong><strong>)</strong>/2&nbsp;+&nbsp;13<strong>;</strong></div></li>
<li><div class="src-line"><a name="a562"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a563"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>$allowDomainBytecodeLength&nbsp;</strong>=&nbsp;<strong>$this</strong><strong>-&gt;</strong><a href="../SWX/SwfCompiler.html#methodgetIntAsHex">getIntAsHex</a><strong>(</strong><strong>$allowDomainBytecodeLengthDec</strong><strong>,&nbsp;</strong>2<strong>)</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a564"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>$allowDomainBytecode&nbsp;</strong>=&nbsp;<font color="#66cccc">'96'&nbsp;</font>.&nbsp;<strong>$allowDomainBytecodeLength&nbsp;</strong>.&nbsp;<strong>$allowDomainBytecode&nbsp;</strong>.&nbsp;<a href="../SWX/_SwfCompiler.php.html#defineSYSTEM_ALLOW_DOMAIN">SYSTEM_ALLOW_DOMAIN</a><strong>;</strong></div></li>
<li><div class="src-line"><a name="a565"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a566"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="blue">return&nbsp;</font><strong>$allowDomainBytecode</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a567"></a>&nbsp;&nbsp;&nbsp;&nbsp;<strong>}</strong></div></li>
<li><div class="src-line"><a name="a568"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a569"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a570"></a>&nbsp;&nbsp;&nbsp;&nbsp;<font color="#009999">/**</font></div></li>
<li><div class="src-line"><a name="a571"></a><font color="#009999">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Helper&nbsp;methods.&nbsp;(For&nbsp;data&nbsp;type&nbsp;conversions,&nbsp;formatting,&nbsp;etc.)</font></div></li>
<li><div class="src-line"><a name="a572"></a><font color="#009999">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</font></div></li>
<li><div class="src-line"><a name="a573"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a574"></a>&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;Returns&nbsp;a&nbsp;string&nbsp;with&nbsp;the&nbsp;length&nbsp;of&nbsp;the&nbsp;passed&nbsp;hex&nbsp;string&nbsp;in&nbsp;bytes</font></div></li>
<li><div class="src-line"><a name="a575"></a>&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;padded&nbsp;to&nbsp;display&nbsp;in&nbsp;$numBytes&nbsp;bytes.</font></div></li>
<li><div class="src-line"><a name="a576"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="blue">function&nbsp;</font><a href="../SWX/SwfCompiler.html#methodgetStringLengthInBytesHex">getStringLengthInBytesHex</a><strong>(</strong><strong>$strInHex</strong><strong>,&nbsp;</strong><strong>$numBytes</strong><strong>)</strong></div></li>
<li><div class="src-line"><a name="a577"></a>&nbsp;&nbsp;&nbsp;&nbsp;<strong>{</strong></div></li>
<li><div class="src-line"><a name="a578"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;Divide&nbsp;length&nbsp;in&nbsp;chars&nbsp;by&nbsp;2&nbsp;to&nbsp;get&nbsp;length&nbsp;in&nbsp;bytes</font></div></li>
<li><div class="src-line"><a name="a579"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>$bytecodeLenInDec&nbsp;</strong>=&nbsp;<a href="http://www.php.net/strlen">strlen</a><strong>(</strong><strong>$strInHex</strong><strong>)</strong>/2<strong>;</strong></div></li>
<li><div class="src-line"><a name="a580"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a581"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>$bytecodeLenInHex&nbsp;</strong>=&nbsp;<strong>$this</strong><strong>-&gt;</strong><a href="../SWX/SwfCompiler.html#methodgetIntAsHex">getIntAsHex</a><strong>(</strong><strong>$bytecodeLenInDec</strong><strong>,&nbsp;</strong><strong>$numBytes</strong><strong>)</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a582"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a583"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="blue">return&nbsp;</font><strong>$bytecodeLenInHex</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a584"></a>&nbsp;&nbsp;&nbsp;&nbsp;<strong>}</strong></div></li>
<li><div class="src-line"><a name="a585"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a586"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a587"></a>&nbsp;&nbsp;&nbsp;&nbsp;<font color="#009999">/**</font></div></li>
<li><div class="src-line"><a name="a588"></a><font color="#009999">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Returns&nbsp;the&nbsp;hexadecimal&nbsp;representation&nbsp;of&nbsp;the&nbsp;passed&nbsp;integer,</font></div></li>
<li><div class="src-line"><a name="a589"></a><font color="#009999">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;padded&nbsp;to&nbsp;$numBytes&nbsp;bytes&nbsp;in&nbsp;little-endian.</font></div></li>
<li><div class="src-line"><a name="a590"></a><font color="#009999">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</font></div></li>
<li><div class="src-line"><a name="a591"></a><font color="#009999">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</font><strong><font color = "#0099FF">@param&nbsp;</font></strong><em>integer&nbsp;</em><font color="#009999">&nbsp;&nbsp;&nbsp;&nbsp;Number&nbsp;to&nbsp;convert&nbsp;to&nbsp;hex&nbsp;byte&nbsp;representation.</font></div></li>
<li><div class="src-line"><a name="a592"></a><font color="#009999">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</font><strong><font color = "#0099FF">@param&nbsp;</font></strong><em>integer&nbsp;</em><font color="#009999">&nbsp;&nbsp;&nbsp;Number&nbsp;of&nbsp;bytes&nbsp;to&nbsp;pad&nbsp;to.</font></div></li>
<li><div class="src-line"><a name="a593"></a><font color="#009999">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</font><strong><font color = "#0099FF">@return&nbsp;</font></strong><em>string&nbsp;</em><font color="#009999">&nbsp;&nbsp;&nbsp;&nbsp;Integer&nbsp;as&nbsp;hex&nbsp;string.</font></div></li>
<li><div class="src-line"><a name="a594"></a><font color="#009999">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</font><strong><font color = "#0099FF">@author</font></strong><font color="#009999">&nbsp;Aral&nbsp;Balkan</font></div></li>
<li><div class="src-line"><a name="a595"></a><font color="#009999">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;***/</font></div></li>
<li><div class="src-line"><a name="a596"></a>&nbsp;&nbsp;&nbsp;&nbsp;<font color="blue">function&nbsp;</font><a href="../SWX/SwfCompiler.html#methodgetIntAsHex">getIntAsHex</a><strong>(</strong><strong>$int</strong><strong>,&nbsp;</strong><strong>$numBytes</strong>=1<strong>)</strong></div></li>
<li><div class="src-line"><a name="a597"></a>&nbsp;&nbsp;&nbsp;&nbsp;<strong>{</strong></div></li>
<li><div class="src-line"><a name="a598"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>$intAsHex&nbsp;</strong>=&nbsp;<a href="http://www.php.net/strtoupper">strtoupper</a><strong>(</strong><a href="http://www.php.net/str_pad">str_pad</a><strong>(</strong><strong>$this</strong><strong>-&gt;</strong><a href="../SWX/SwfCompiler.html#methodmakeLittleEndian">makeLittleEndian</a><strong>(</strong><a href="http://www.php.net/dechex">dechex</a><strong>(</strong><strong>$int</strong><strong>))</strong><strong>,&nbsp;</strong><strong>$numBytes</strong>*2<strong>,&nbsp;</strong><font color="#66cccc">'0'</font><strong>))</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a599"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="blue">return&nbsp;</font><strong>$intAsHex</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a600"></a>&nbsp;&nbsp;&nbsp;&nbsp;<strong>}</strong></div></li>
<li><div class="src-line"><a name="a601"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a602"></a>&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//////////////////////////////////////////////////////////////////////</font></div></li>
<li><div class="src-line"><a name="a603"></a>&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//</font></div></li>
<li><div class="src-line"><a name="a604"></a>&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;makeLittleEndian()</font></div></li>
<li><div class="src-line"><a name="a605"></a>&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//</font></div></li>
<li><div class="src-line"><a name="a606"></a>&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;Takes&nbsp;a&nbsp;hex&nbsp;string&nbsp;in&nbsp;big&nbsp;endian&nbsp;and&nbsp;coverts&nbsp;it&nbsp;to&nbsp;little&nbsp;endian</font></div></li>
<li><div class="src-line"><a name="a607"></a>&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//</font></div></li>
<li><div class="src-line"><a name="a608"></a>&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//////////////////////////////////////////////////////////////////////</font></div></li>
<li><div class="src-line"><a name="a609"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="blue">function&nbsp;</font><a href="../SWX/SwfCompiler.html#methodmakeLittleEndian">makeLittleEndian</a><strong>(</strong><strong>$str</strong><strong>)</strong></div></li>
<li><div class="src-line"><a name="a610"></a>&nbsp;&nbsp;&nbsp;&nbsp;<strong>{</strong></div></li>
<li><div class="src-line"><a name="a611"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>$sLen&nbsp;</strong>=&nbsp;<a href="http://www.php.net/strlen">strlen</a><strong>(</strong><strong>$str</strong><strong>)</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a612"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a613"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;Make&nbsp;sure&nbsp;that&nbsp;the&nbsp;string&nbsp;is&nbsp;padded&nbsp;to&nbsp;the&nbsp;byte&nbsp;boundary</font></div></li>
<li><div class="src-line"><a name="a614"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="blue">if&nbsp;</font><strong>(</strong><strong>$sLen</strong>%2&nbsp;==&nbsp;1<strong>)&nbsp;</strong></div></li>
<li><div class="src-line"><a name="a615"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>{</strong></div></li>
<li><div class="src-line"><a name="a616"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>$sLen</strong>++<strong>;</strong></div></li>
<li><div class="src-line"><a name="a617"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>$str&nbsp;</strong>=&nbsp;<font color="#66cccc">'0'</font>.<strong>$str</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a618"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>}</strong></div></li>
<li><div class="src-line"><a name="a619"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a620"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>$sLenInBytes&nbsp;</strong>=&nbsp;<strong>$sLen</strong>/2<strong>;</strong></div></li>
<li><div class="src-line"><a name="a621"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a622"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>$strArr&nbsp;</strong>=&nbsp;str_split<strong>(</strong><strong>$str</strong><strong>,&nbsp;</strong>2<strong>)</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a623"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a624"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>$strArr&nbsp;</strong>=&nbsp;<a href="http://www.php.net/array_reverse">array_reverse</a><strong>(</strong><strong>$strArr</strong><strong>)</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a625"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>$strLittleEndian&nbsp;</strong>=&nbsp;<a href="http://www.php.net/implode">implode</a><strong>(</strong><font color="#66cccc">''</font><strong>,&nbsp;</strong><strong>$strArr</strong><strong>)</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a626"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a627"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="blue">return&nbsp;</font><strong>$strLittleEndian</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a628"></a>&nbsp;&nbsp;&nbsp;&nbsp;<strong>}</strong></div></li>
<li><div class="src-line"><a name="a629"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a630"></a>&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//////////////////////////////////////////////////////////////////////</font></div></li>
<li><div class="src-line"><a name="a631"></a>&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//</font></div></li>
<li><div class="src-line"><a name="a632"></a>&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;prettyHex()</font></div></li>
<li><div class="src-line"><a name="a633"></a>&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//</font></div></li>
<li><div class="src-line"><a name="a634"></a>&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;Pretty&nbsp;prints&nbsp;hex&nbsp;string&nbsp;in&nbsp;1&nbsp;bytes&nbsp;groups,&nbsp;10&nbsp;to&nbsp;a&nbsp;line</font></div></li>
<li><div class="src-line"><a name="a635"></a>&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;and&nbsp;show&nbsp;number&nbsp;of&nbsp;bytes&nbsp;in&nbsp;the&nbsp;string.</font></div></li>
<li><div class="src-line"><a name="a636"></a>&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//</font></div></li>
<li><div class="src-line"><a name="a637"></a>&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//////////////////////////////////////////////////////////////////////</font></div></li>
<li><div class="src-line"><a name="a638"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="blue">function&nbsp;</font><a href="../SWX/SwfCompiler.html#methodprettyHex">prettyHex</a>&nbsp;<strong>(</strong><strong>$h</strong><strong>)</strong></div></li>
<li><div class="src-line"><a name="a639"></a>&nbsp;&nbsp;&nbsp;&nbsp;<strong>{</strong></div></li>
<li><div class="src-line"><a name="a640"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>$pretty&nbsp;</strong>=&nbsp;<font color="#66cccc">&quot;\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;01&nbsp;02&nbsp;03&nbsp;04&nbsp;05&nbsp;06&nbsp;07&nbsp;08&nbsp;09&nbsp;10\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-----------------------------\n0001|&nbsp;&quot;</font><strong>;</strong></div></li>
<li><div class="src-line"><a name="a641"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>$hArr&nbsp;</strong>=&nbsp;str_split<strong>(</strong><strong>$h</strong><strong>,&nbsp;</strong>2<strong>)</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a642"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a643"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>$lineCount&nbsp;</strong>=&nbsp;1<strong>;</strong></div></li>
<li><div class="src-line"><a name="a644"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a645"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="blue">for&nbsp;</font><strong>(</strong><strong>$i&nbsp;</strong>=&nbsp;0<strong>;&nbsp;</strong><strong>$i&nbsp;</strong>&lt;&nbsp;<a href="http://www.php.net/count">count</a><strong>(</strong><strong>$hArr</strong><strong>)</strong><strong>;&nbsp;</strong><strong>$i</strong>++<strong>)</strong></div></li>
<li><div class="src-line"><a name="a646"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>{</strong></div></li>
<li><div class="src-line"><a name="a647"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>$pretty&nbsp;</strong>.=&nbsp;<strong>$hArr</strong><strong>[</strong><strong>$i</strong><strong>]&nbsp;</strong>.&nbsp;<font color="#66cccc">'&nbsp;'</font><strong>;</strong></div></li>
<li><div class="src-line"><a name="a648"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="blue">if&nbsp;</font><strong>((</strong><strong>$i</strong>+1<strong>)</strong>%10&nbsp;==&nbsp;0&nbsp;&nbsp;<strong>)</strong></div></li>
<li><div class="src-line"><a name="a649"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>{</strong></div></li>
<li><div class="src-line"><a name="a650"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>$lineCount</strong>++<strong>;</strong></div></li>
<li><div class="src-line"><a name="a651"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>$pretty&nbsp;</strong>.=&nbsp;<font color="#66cccc">&quot;\n&quot;</font>.<a href="http://www.php.net/str_pad">str_pad</a><strong>(</strong><strong>$lineCount</strong><strong>,&nbsp;</strong>4<strong>,&nbsp;</strong><font color="#66cccc">&quot;0&quot;</font><strong>,&nbsp;</strong>STR_PAD_LEFT<strong>)</strong>.<font color="#66cccc">'|&nbsp;'</font><strong>;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</strong></div></li>
<li><div class="src-line"><a name="a652"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>}</strong></div></li>
<li><div class="src-line"><a name="a653"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>}</strong></div></li>
<li><div class="src-line"><a name="a654"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>$pretty&nbsp;</strong>.=&nbsp;<font color="#66cccc">&quot;</font><font color="#66cccc">\n\n<strong>$h</strong>\n\nNum&nbsp;bytes:&nbsp;</font><font color="#66cccc">&quot;</font>.<a href="http://www.php.net/count">count</a><strong>(</strong><strong>$hArr</strong><strong>)</strong>.<font color="#66cccc">&quot;\n&quot;</font><strong>;</strong></div></li>
<li><div class="src-line"><a name="a655"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a656"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="blue">return&nbsp;</font><strong>$pretty</strong><strong>;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</strong></div></li>
<li><div class="src-line"><a name="a657"></a>&nbsp;&nbsp;&nbsp;&nbsp;<strong>}</strong></div></li>
<li><div class="src-line"><a name="a658"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a659"></a>&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//////////////////////////////////////////////////////////////////////</font></div></li>
<li><div class="src-line"><a name="a660"></a>&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//</font></div></li>
<li><div class="src-line"><a name="a661"></a>&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;debug()</font></div></li>
<li><div class="src-line"><a name="a662"></a>&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//</font></div></li>
<li><div class="src-line"><a name="a663"></a>&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;Debug&nbsp;only&nbsp;displays&nbsp;debug&nbsp;messages&nbsp;if&nbsp;we</font></div></li>
<li><div class="src-line"><a name="a664"></a>&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;are&nbsp;not&nbsp;writing&nbsp;out&nbsp;a&nbsp;SWF.</font></div></li>
<li><div class="src-line"><a name="a665"></a>&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//</font></div></li>
<li><div class="src-line"><a name="a666"></a>&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//////////////////////////////////////////////////////////////////////</font></div></li>
<li><div class="src-line"><a name="a667"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="blue">function&nbsp;</font><a href="../SWX/SwfCompiler.html#methoddebug">debug</a><strong>(</strong><strong>$str</strong><strong>)</strong></div></li>
<li><div class="src-line"><a name="a668"></a>&nbsp;&nbsp;&nbsp;&nbsp;<strong>{</strong></div></li>
<li><div class="src-line"><a name="a669"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="blue">global&nbsp;</font><strong>$isPost</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a670"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="blue">if&nbsp;</font><strong>(</strong><strong>$isPost&nbsp;</strong>||&nbsp;isset<strong>(</strong><strong>$_GET</strong><strong>[</strong><font color="#66cccc">'swf'</font><strong>]</strong><strong>))</strong></div></li>
<li><div class="src-line"><a name="a671"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>{</strong></div></li>
<li><div class="src-line"><a name="a672"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="blue">return</font><strong>;</strong></div></li>
<li><div class="src-line"><a name="a673"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>}</strong></div></li>
<li><div class="src-line"><a name="a674"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else</div></li>
<li><div class="src-line"><a name="a675"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>{</strong></div></li>
<li><div class="src-line"><a name="a676"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;<strong>$str</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a677"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>}</strong></div></li>
<li><div class="src-line"><a name="a678"></a>&nbsp;&nbsp;&nbsp;&nbsp;<strong>}</strong></div></li>
<li><div class="src-line"><a name="a679"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a680"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a681"></a>&nbsp;&nbsp;&nbsp;&nbsp;<font color="#009999">/**</font></div></li>
<li><div class="src-line"><a name="a682"></a><font color="#009999">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Converts&nbsp;a&nbsp;string&nbsp;of&nbsp;hexadecimal&nbsp;values&nbsp;to&nbsp;a&nbsp;string&nbsp;of&nbsp;ASCII&nbsp;characters.</font></div></li>
<li><div class="src-line"><a name="a683"></a><font color="#009999">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</font></div></li>
<li><div class="src-line"><a name="a684"></a><font color="#009999">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</font><strong><font color = "#0099FF">@return&nbsp;</font></strong><em>string&nbsp;</em><font color="#009999">String&nbsp;with&nbsp;ASCII&nbsp;characters</font></div></li>
<li><div class="src-line"><a name="a685"></a><font color="#009999">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</font><strong><font color = "#0099FF">@author</font></strong><font color="#009999">&nbsp;Paul&nbsp;Gregg&nbsp;&lt;pgregg@pgregg.com&gt;</font></div></li>
<li><div class="src-line"><a name="a686"></a><font color="#009999">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</font><strong><font color = "#0099FF">@link</font></strong><font color="#009999">&nbsp;http://www.pgregg.com/projects/php/code/hexstr.phps</font></div></li>
<li><div class="src-line"><a name="a687"></a><font color="#009999">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;***/</font></div></li>
<li><div class="src-line"><a name="a688"></a>&nbsp;&nbsp;&nbsp;&nbsp;<font color="blue">function&nbsp;</font><a href="../SWX/SwfCompiler.html#methodhexstr">hexstr</a><strong>(</strong><strong>$hexstr</strong><strong>)&nbsp;</strong></div></li>
<li><div class="src-line"><a name="a689"></a>&nbsp;&nbsp;&nbsp;&nbsp;<strong>{</strong></div></li>
<li><div class="src-line"><a name="a690"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>$hexstr&nbsp;</strong>=&nbsp;<a href="http://www.php.net/str_replace">str_replace</a><strong>(</strong><font color="#66cccc">'&nbsp;'</font><strong>,&nbsp;</strong><font color="#66cccc">''</font><strong>,&nbsp;</strong><strong>$hexstr</strong><strong>)</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a691"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>$retstr&nbsp;</strong>=&nbsp;<a href="http://www.php.net/pack">pack</a><strong>(</strong><font color="#66cccc">'H*'</font><strong>,&nbsp;</strong><strong>$hexstr</strong><strong>)</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a692"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="blue">return&nbsp;</font><strong>$retstr</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a693"></a>&nbsp;&nbsp;&nbsp;&nbsp;<strong>}</strong></div></li>
<li><div class="src-line"><a name="a694"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a695"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a696"></a>&nbsp;&nbsp;&nbsp;&nbsp;<font color="#009999">/**</font></div></li>
<li><div class="src-line"><a name="a697"></a><font color="#009999">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Converts&nbsp;a&nbsp;string&nbsp;of&nbsp;ASCII&nbsp;characters&nbsp;to&nbsp;a&nbsp;string&nbsp;of&nbsp;hexadecimal&nbsp;byte&nbsp;values.</font></div></li>
<li><div class="src-line"><a name="a698"></a><font color="#009999">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</font></div></li>
<li><div class="src-line"><a name="a699"></a><font color="#009999">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</font><strong><font color = "#0099FF">@return&nbsp;</font></strong><em>string&nbsp;</em><font color="#009999">String&nbsp;with&nbsp;ASCII&nbsp;characters</font></div></li>
<li><div class="src-line"><a name="a700"></a><font color="#009999">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</font><strong><font color = "#0099FF">@author</font></strong><font color="#009999">&nbsp;Paul&nbsp;Gregg&nbsp;&lt;pgregg@pgregg.com&gt;</font></div></li>
<li><div class="src-line"><a name="a701"></a><font color="#009999">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</font><strong><font color = "#0099FF">@author</font></strong><font color="#009999">&nbsp;Aral&nbsp;Balkan&nbsp;(added&nbsp;PHP4&nbsp;bug&nbsp;fix)</font></div></li>
<li><div class="src-line"><a name="a702"></a><font color="#009999">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</font><strong><font color = "#0099FF">@link</font></strong><font color="#009999">&nbsp;http://www.pgregg.com/projects/php/code/hexstr.phps</font></div></li>
<li><div class="src-line"><a name="a703"></a><font color="#009999">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;***/</font></div></li>
<li><div class="src-line"><a name="a704"></a>&nbsp;&nbsp;&nbsp;&nbsp;<font color="blue">function&nbsp;</font><a href="../SWX/SwfCompiler.html#methodstrhex">strhex</a><strong>(</strong><strong>$string</strong><strong>)&nbsp;</strong></div></li>
<li><div class="src-line"><a name="a705"></a>&nbsp;&nbsp;&nbsp;&nbsp;<strong>{</strong></div></li>
<li><div class="src-line"><a name="a706"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>$hexstr&nbsp;</strong>=&nbsp;<a href="http://www.php.net/unpack">unpack</a><strong>(</strong><font color="#66cccc">'H*'</font><strong>,&nbsp;</strong><strong>$string</strong><strong>)</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a707"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a708"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;Fix&nbsp;for&nbsp;unpack&nbsp;bug&nbsp;</font></div></li>
<li><div class="src-line"><a name="a709"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;http://bugs.php.net/bug.php?id=36148</font></div></li>
<li><div class="src-line"><a name="a710"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;PHP&nbsp;4&nbsp;and&nbsp;5&nbsp;appear&nbsp;to&nbsp;give&nbsp;different&nbsp;results&nbsp;for&nbsp;the&nbsp;unpack</font></div></li>
<li><div class="src-line"><a name="a711"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;PHP&nbsp;4.4.3+&nbsp;exhibits&nbsp;same&nbsp;behavior&nbsp;as&nbsp;PHP&nbsp;5.</font></div></li>
<li><div class="src-line"><a name="a712"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;PHP&nbsp;version&nbsp;5.1.2&nbsp;exhibits&nbsp;the&nbsp;same&nbsp;behavior&nbsp;as&nbsp;PHP&nbsp;4.</font></div></li>
<li><div class="src-line"><a name="a713"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;Tested&nbsp;with:&nbsp;4.4.2,&nbsp;4.4.3,&nbsp;4.4.4,&nbsp;5.1.4,&nbsp;5.1.6,&nbsp;5.2.1.</font></div></li>
<li><div class="src-line"><a name="a714"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;Definitely&nbsp;*not*&nbsp;supported&nbsp;on&nbsp;4.3.10&nbsp;(or&nbsp;the&nbsp;4.3&nbsp;branch&nbsp;at&nbsp;all.)</font></div></li>
<li><div class="src-line"><a name="a715"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//</font></div></li>
<li><div class="src-line"><a name="a716"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;TODO:&nbsp;Look&nbsp;for&nbsp;a&nbsp;way&nbsp;to&nbsp;optimize&nbsp;this.</font></div></li>
<li><div class="src-line"><a name="a717"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a718"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>$phpVer&nbsp;</strong>=&nbsp;<a href="http://www.php.net/phpversion">phpversion</a><strong>(</strong><strong>)</strong><strong>;&nbsp;</strong></div></li>
<li><div class="src-line"><a name="a719"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a720"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="blue">if&nbsp;</font><strong>(&nbsp;(</strong><a href="http://www.php.net/substr">substr</a><strong>(</strong><strong>$phpVer</strong><strong>,</strong>0<strong>,</strong>1<strong>)&nbsp;</strong>==&nbsp;<font color="#66cccc">'4'&nbsp;</font>&amp;&amp;&nbsp;<a href="http://www.php.net/intval">intval</a><strong>(</strong><a href="http://www.php.net/substr">substr</a><strong>(</strong><strong>$phpVer</strong><strong>,</strong>4<strong>,&nbsp;</strong>1<strong>))&nbsp;</strong>&lt;&nbsp;3<strong>)&nbsp;&nbsp;</strong>||&nbsp;<strong>$phpVer&nbsp;</strong>==&nbsp;<font color="#66cccc">'5.1.2'</font><strong>)</strong></div></li>
<li><div class="src-line"><a name="a721"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>{</strong></div></li>
<li><div class="src-line"><a name="a722"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;PHP&nbsp;4</font></div></li>
<li><div class="src-line"><a name="a723"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="blue">return&nbsp;</font><a href="http://www.php.net/substr">substr</a><strong>(</strong><strong>$hexstr</strong><strong>[</strong>1<strong>]</strong><strong>,&nbsp;</strong>0<strong>,&nbsp;</strong>-1<strong>)</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a724"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>}</strong></div></li>
<li><div class="src-line"><a name="a725"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else</div></li>
<li><div class="src-line"><a name="a726"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>{</strong></div></li>
<li><div class="src-line"><a name="a727"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;PHP&nbsp;4.4.3+&nbsp;and&nbsp;5.1.4+</font></div></li>
<li><div class="src-line"><a name="a728"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="blue">return&nbsp;</font><a href="http://www.php.net/array_shift">array_shift</a><strong>(</strong><strong>$hexstr</strong><strong>)</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a729"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>}</strong></div></li>
<li><div class="src-line"><a name="a730"></a>&nbsp;&nbsp;&nbsp;&nbsp;<strong>}</strong></div></li>
<li><div class="src-line"><a name="a731"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a732"></a>&nbsp;&nbsp;&nbsp;&nbsp;<font color="green">//&nbsp;Profiling</font></div></li>
<li><div class="src-line"><a name="a733"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="blue">function&nbsp;</font><a href="../SWX/SwfCompiler.html#methodmicrotime_float">microtime_float</a><strong>(</strong><strong>)</strong></div></li>
<li><div class="src-line"><a name="a734"></a>&nbsp;&nbsp;&nbsp;&nbsp;<strong>{</strong></div></li>
<li><div class="src-line"><a name="a735"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;list<strong>(</strong><strong>$usec</strong><strong>,&nbsp;</strong><strong>$sec</strong><strong>)&nbsp;</strong>=&nbsp;<a href="http://www.php.net/explode">explode</a><strong>(</strong><font color="#66cccc">&quot;&nbsp;&quot;</font><strong>,&nbsp;</strong><a href="http://www.php.net/microtime">microtime</a><strong>(</strong><strong>))</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a736"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="blue">return&nbsp;</font><strong>(</strong>(float)<strong>$usec&nbsp;</strong>+&nbsp;(float)<strong>$sec</strong><strong>)</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a737"></a>&nbsp;&nbsp;&nbsp;&nbsp;<strong>}</strong></div></li>
<li><div class="src-line"><a name="a738"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a739"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a740"></a><strong>}</strong></div></li>
<li><div class="src-line"><a name="a741"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a742"></a><font color="green">//</font></div></li>
<li><div class="src-line"><a name="a743"></a><font color="green">//&nbsp;SWF&nbsp;bytecode&nbsp;constants.&nbsp;Discovered&nbsp;through&nbsp;observation.</font></div></li>
<li><div class="src-line"><a name="a744"></a><font color="green">//&nbsp;</font></div></li>
<li><div class="src-line"><a name="a745"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a746"></a><font color="green">//&nbsp;Header&nbsp;-&nbsp;FCS&nbsp;(uncompressed),&nbsp;version&nbsp;Flash&nbsp;6</font></div></li>
<li><div class="src-line"><a name="a747"></a><a href="http://www.php.net/define">define</a><strong>(</strong><font color="#66cccc">'UNCOMPRESSED_SWF'</font><strong>,&nbsp;</strong><font color="#66cccc">'46'</font><strong>)</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a748"></a><a href="http://www.php.net/define">define</a><strong>(</strong><font color="#66cccc">'COMPRESSED_SWF'</font><strong>,&nbsp;</strong><font color="#66cccc">'43'</font><strong>)</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a749"></a><a href="http://www.php.net/define">define</a><strong>(</strong><font color="#66cccc">'HEADER'</font><strong>,&nbsp;</strong><font color="#66cccc">'575306LLLLLLLL300A00A0000101004302FFFFFF'</font><strong>)</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a750"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a751"></a><font color="green">//&nbsp;Action&nbsp;bytecodes</font></div></li>
<li><div class="src-line"><a name="a752"></a><a href="http://www.php.net/define">define</a><strong>(</strong><font color="#66cccc">'ACTION_PUSH'</font><strong>,&nbsp;</strong><font color="#66cccc">'96LLLL'</font><strong>)</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a753"></a><a href="http://www.php.net/define">define</a><strong>(</strong><font color="#66cccc">'ACTION_SHOW_FRAME'</font><strong>,&nbsp;</strong><font color="#66cccc">'4000'</font><strong>)</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a754"></a><a href="http://www.php.net/define">define</a><strong>(</strong><font color="#66cccc">'ACTION_END_SWF'</font><strong>,&nbsp;</strong><font color="#66cccc">'0000'</font><strong>)</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a755"></a><a href="http://www.php.net/define">define</a><strong>(</strong><font color="#66cccc">'ACTION_SET_VARIABLE'</font><strong>,&nbsp;</strong><font color="#66cccc">'1D'</font><strong>)</strong><strong>;&nbsp;&nbsp;</strong><font color="green">//&nbsp;00</font></div></li>
<li><div class="src-line"><a name="a756"></a><a href="http://www.php.net/define">define</a><strong>(</strong><font color="#66cccc">'ACTION_DO_ACTION'</font><strong>,&nbsp;</strong><font color="#66cccc">'3F03'</font><strong>)</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a757"></a><a href="http://www.php.net/define">define</a><strong>(</strong><font color="#66cccc">'ACTION_INIT_ARRAY'</font><strong>,&nbsp;</strong><font color="#66cccc">'42'</font><strong>)</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a758"></a><a href="http://www.php.net/define">define</a><strong>(</strong><font color="#66cccc">'ACTION_INIT_OBJECT'</font><strong>,&nbsp;</strong><font color="#66cccc">'43'</font><strong>)</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a759"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a760"></a><font color="green">//&nbsp;Data&nbsp;type&nbsp;codes</font></div></li>
<li><div class="src-line"><a name="a761"></a><a href="http://www.php.net/define">define</a><strong>(</strong><font color="#66cccc">'DATA_TYPE_STRING'</font><strong>,&nbsp;&nbsp;</strong><font color="#66cccc">'00'</font><strong>)</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a762"></a><a href="http://www.php.net/define">define</a><strong>(</strong><font color="#66cccc">'DATA_TYPE_NULL'</font><strong>,&nbsp;&nbsp;</strong><font color="#66cccc">'02'</font><strong>)</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a763"></a><a href="http://www.php.net/define">define</a><strong>(</strong><font color="#66cccc">'DATA_TYPE_BOOLEAN'</font><strong>,&nbsp;</strong><font color="#66cccc">'05'</font><strong>)</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a764"></a><a href="http://www.php.net/define">define</a><strong>(</strong><font color="#66cccc">'DATA_TYPE_DOUBLE'</font><strong>,&nbsp;</strong><font color="#66cccc">'06'</font><strong>)</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a765"></a><a href="http://www.php.net/define">define</a><strong>(</strong><font color="#66cccc">'DATA_TYPE_INTEGER'</font><strong>,&nbsp;</strong><font color="#66cccc">'07'</font><strong>)</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a766"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a767"></a><font color="green">//&nbsp;Misc</font></div></li>
<li><div class="src-line"><a name="a768"></a><a href="http://www.php.net/define">define</a><strong>(</strong><font color="#66cccc">'NULL_TERMINATOR'</font><strong>,&nbsp;</strong><font color="#66cccc">'00'</font><strong>)</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a769"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a770"></a><font color="green">//&nbsp;Non-bytecode&nbsp;constants</font></div></li>
<li><div class="src-line"><a name="a771"></a><a href="http://www.php.net/define">define</a><strong>(</strong><font color="#66cccc">'ARRAY_TYPE_REGULAR'</font><strong>,&nbsp;</strong><font color="#66cccc">'regular'</font><strong>)</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a772"></a><a href="http://www.php.net/define">define</a><strong>(</strong><font color="#66cccc">'ARRAY_TYPE_ASSOCIATIVE'</font><strong>,&nbsp;</strong><font color="#66cccc">'associative'</font><strong>)</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a773"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a774"></a><font color="green">//&nbsp;Allow&nbsp;domain&nbsp;(*)</font></div></li>
<li><div class="src-line"><a name="a775"></a><a href="http://www.php.net/define">define</a><strong>(</strong><font color="#66cccc">'ALLOW_DOMAIN'</font><strong>,&nbsp;</strong><font color="#66cccc">'960900005F706172656E74001C960600005F75726C004E960D0007010000000053797374656D001C960A00007365637572697479004E960D0000616C6C6F77446F6D61696E005217'</font><strong>)</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a776"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a777"></a><a href="http://www.php.net/define">define</a><strong>(</strong><font color="#66cccc">'SYSTEM_ALLOW_DOMAIN'</font><strong>,&nbsp;</strong><font color="#66cccc">'07010000000053797374656D001C960A00007365637572697479004E960D0000616C6C6F77446F6D61696E005217'</font><strong>)</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a778"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a779"></a><font color="green">//&nbsp;Debug&nbsp;SWX&nbsp;bytecode.&nbsp;Creates&nbsp;a&nbsp;local&nbsp;connection&nbsp;to&nbsp;the&nbsp;SWX&nbsp;Debugger&nbsp;front-end.)</font></div></li>
<li><div class="src-line"><a name="a780"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a781"></a><a href="http://www.php.net/define">define</a><strong>(</strong><font color="#66cccc">'DEBUG_START'</font><strong>,</strong><font color="#66cccc">'883C000700726573756C74006C63004C6F63616C436F6E6E656374696F6E005F737778446562756767657200636F6E6E6563740064656275670073656E6400'</font><strong>)</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a782"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a783"></a><a href="http://www.php.net/define">define</a><strong>(</strong><font color="#66cccc">'DEBUG_END'</font><strong>,&nbsp;</strong><font color="#66cccc">'960D0008010600000000000000000802403C9609000803070100000008011C9602000804521796020008001C960500070100000042960B0008050803070300000008011C96020008065217'</font><strong>)</strong><strong>;</strong></div></li>
<li><div class="src-line"><a name="a784"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a785"></a><strong>?&gt;</strong></div></li>
</ol></div>
</div>
	<div id="credit">
		<hr />
		Documentation generated on Fri, 06 Jul 2007 19:54:52 +0100 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.3.1</a>
	</div>
</body>
</html>